Action: CREATE_MASK
Module | generic |
---|---|
Description | Usage |
Create a mask vector to use for landmark selection | |
output value | type |
a vector of zeros and ones that is used that can be used to mask some of the elements in a time series | vector |
Input
The arguments that serve as the input for this action are specified using one or more of the keywords in the following table.
Keyword | Type | Description |
---|---|---|
ARG | vector | the label of the vector that you would like to construct a mask for |
Further details and examples
Create a mask vector to use for landmark selection
This action should be used in conjuction with the SELECT_WITH_MASK action. As is explained in the documentation for SELECT_WITH_MASK, SELECT_WITH_MASK allows you to output a scalar vector or matrix that contains a subset of the elements in the input vector or matrix. The following example shows how this action works in practice.
dDISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=1,2 ATOMS2the pair of atom that we are calculating the distance between=3,4 ATOMS3the pair of atom that we are calculating the distance between=5,6 mCONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUESthe numbers that are in your constant value=1,0,1 : v : SELECT_WITH_MASKUse a mask to select elements of an array More details ARGthe label for the value upon which you are going to apply the mask=d MASKan array with ones in the components that you want to discard=m:
In the input above, The value, m
, that is passed to the keyword MASK here is a vector with the same length as d
.
Elements of d
that whose corresponding elements in m
are zero are copied to the output value v
.
When elements of m
are non-zero the corresponding elements in d
are not transferred to the output
value - they are masked. Consequently, although the input, d
, to the select SELECT_WITH_MASK action is a vector
with 3 elements the output, v
, is a scalar.
In the vast majority of cases you can use the CONSTANT action to create the values that are passed to the
SELECT_WITH_MASK action using the MASK
keyword as the size of the input vector is known when you write the input file.
The one exception to this is if you are using a COLLECT action like the one shown below:
dDISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 cCOLLECTCollect data from the trajectory for later analysis This action has hidden defaults. More details ARGthe label of the value whose time series is being stored for later analysis=d STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 ::
The vector c
here will have as many frames as there are frames in the trajectory that is being generated or analysed.
Normally, with an input like this a user will want to analyse all the data in the whole trajectory at once without
specifying the trajectories length to PLUMED. action should was desgined to create inputs to the MASK keyword for
SELECT_WITH_MASK action in this particular case. Basically it creates a vector of ones and
zeros that has the same length as the input vector.
There are three modes for creating these vectors and ones and zeros. This first one creates a mask vector in which
every element is equal to zero. The output from the SELECT_WITH_MASK command, v
, is thus identical to the output from
the collect command, d
.
dDISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 cCOLLECTCollect data from the trajectory for later analysis This action has hidden defaults. More details ARGthe label of the value whose time series is being stored for later analysis=d STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 : m : CREATE_MASKCreate a mask vector to use for landmark selection More details TYPEthe way the zeros are supposed to be set=nomask ARGthe label of the vector that you would like to construct a mask for=c v : SELECT_WITH_MASKUse a mask to select elements of an array More details ARGthe label for the value upon which you are going to apply the mask=c MASKan array with ones in the components that you want to discard=m:
The second mode, which is illustrated below, sets N randomly-chosen elements of the mask equal to zero.
dDISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 cCOLLECTCollect data from the trajectory for later analysis This action has hidden defaults. More details ARGthe label of the value whose time series is being stored for later analysis=d STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 : m : CREATE_MASKCreate a mask vector to use for landmark selection More details TYPEthe way the zeros are supposed to be set=random NZEROSthe number of zeros that you want to put in the mask=20 ARGthe label of the vector that you would like to construct a mask for=c v : SELECT_WITH_MASKUse a mask to select elements of an array More details ARGthe label for the value upon which you are going to apply the mask=c MASKan array with ones in the components that you want to discard=m:
The vector v
that is output by the SELECT_WITH_MASK command contains 20 randomly selected elements from the input vector c
.
The third and final mode, which is illustrated below, selects a set of N evenly spaced points from the input vector.
dDISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 cCOLLECTCollect data from the trajectory for later analysis This action has hidden defaults. More details ARGthe label of the value whose time series is being stored for later analysis=d STRIDE the frequency with which the data should be collected and added to the quantity being averaged=1 : m : CREATE_MASKCreate a mask vector to use for landmark selection More details TYPEthe way the zeros are supposed to be set=stride NZEROSthe number of zeros that you want to put in the mask=20 ARGthe label of the vector that you would like to construct a mask for=c v : SELECT_WITH_MASKUse a mask to select elements of an array More details ARGthe label for the value upon which you are going to apply the mask=c MASKan array with ones in the components that you want to discard=m:
The vector v
that is output by the SELECT_WITH_MASK command contains 20 elements from the input vector c
. If c
has
200 elements then v
will contain every 20th element of the input vector c
.
For more examples that demonstrate how this action is used look at the actions in the landmarks module.
Syntax
The following table describes the keywords and options that can be used with this action
Keyword | Type | Default | Description |
---|---|---|---|
ARG | input | none | the label of the vector that you would like to construct a mask for |
TYPE | compulsory | none | the way the zeros are supposed to be set |
NZEROS | compulsory | none | the number of zeros that you want to put in the mask |
NUMERICAL_DERIVATIVES | optional | false | calculate the derivatives for these quantities numerically |
SEED | optional | not used | the seed to use for the random number generator |