This ForwardingDescriptor modifies the indexes (n, t, x) by replacing one of them (normally t) with a constant value and keeping the rest. More...
#include <nnet-descriptor.h>
Public Types | |
enum | VariableName { kN = 0, kT = 1, kX = 2 } |
Public Member Functions | |
virtual Cindex | MapToInput (const Index &ind) const |
virtual int32 | Dim (const Nnet &nnet) const |
virtual ForwardingDescriptor * | Copy () const |
virtual void | WriteConfig (std::ostream &os, const std::vector< std::string > &node_names) const |
virtual void | GetNodeDependencies (std::vector< int32 > *node_indexes) const |
This function appends to "node_indexes" all the node indexes. More... | |
virtual BaseFloat | GetScaleForNode (int32 node_index) const |
This function returns the scale on the node-index 'node_index' when it appears in expressions inside this descriptor, or +infinity if it does not appear. More... | |
ReplaceIndexForwardingDescriptor (ForwardingDescriptor *src, VariableName variable_name, int32 value) | |
virtual | ~ReplaceIndexForwardingDescriptor () |
Public Member Functions inherited from ForwardingDescriptor | |
virtual int32 | Modulus () const |
This function is for use in things like clockwork RNNs, where shifting the time of the inputs and outputs of the network by some multiple integer n would leave things the same, but shifting by non-multiples would change the network structure. More... | |
virtual | ~ForwardingDescriptor () |
ForwardingDescriptor () | |
Private Attributes | |
ForwardingDescriptor * | src_ |
VariableName | variable_name_ |
int32 | value_ |
This ForwardingDescriptor modifies the indexes (n, t, x) by replacing one of them (normally t) with a constant value and keeping the rest.
Written form is: `ReplaceIndex(<descriptor>, <variable-name>,
)` e.g. `ReplaceIndex(ivector, t, 0)`
Definition at line 273 of file nnet-descriptor.h.
enum VariableName |
|
inline |
Definition at line 291 of file nnet-descriptor.h.
|
inlinevirtual |
Definition at line 296 of file nnet-descriptor.h.
|
virtual |
Implements ForwardingDescriptor.
Definition at line 237 of file nnet-descriptor.cc.
Implements ForwardingDescriptor.
Definition at line 278 of file nnet-descriptor.h.
References ForwardingDescriptor::Copy(), ForwardingDescriptor::GetNodeDependencies(), ForwardingDescriptor::GetScaleForNode(), and ForwardingDescriptor::WriteConfig().
|
virtual |
This function appends to "node_indexes" all the node indexes.
Implements ForwardingDescriptor.
Definition at line 215 of file nnet-descriptor.cc.
This function returns the scale on the node-index 'node_index' when it appears in expressions inside this descriptor, or +infinity if it does not appear.
E.g. if the descriptor is just `Scale(tdnn2, 2.0)` and the node index for `tdnn2` is 4, then GetScaleForNode(4) would return 2.0. If a particular node_index > 0 appears in different sub-expressions of the descriptor with different scales it is an error (it's not supported) and this function would crash.
Implements ForwardingDescriptor.
Definition at line 220 of file nnet-descriptor.cc.
Implements ForwardingDescriptor.
Definition at line 225 of file nnet-descriptor.cc.
References KALDI_ERR, Index::t, and Index::x.
|
virtual |
Implements ForwardingDescriptor.
Definition at line 243 of file nnet-descriptor.cc.
References KALDI_ASSERT.
|
private |
Definition at line 298 of file nnet-descriptor.h.
|
private |
Definition at line 300 of file nnet-descriptor.h.
|
private |
Definition at line 299 of file nnet-descriptor.h.