NetworkNode is used to represent, three types of thing: either an input of the network (which pretty much just states the dimension of the input vector); a Component (e.g. More...
#include <nnet-nnet.h>
Public Member Functions | |
int32 | Dim (const Nnet &nnet) const |
NetworkNode (NodeType nt=kNone) | |
NetworkNode (const NetworkNode &other) | |
Public Attributes | |
NodeType | node_type |
Descriptor | descriptor |
union { | |
int32 component_index | |
int32 node_index | |
ObjectiveType objective_type | |
} | u |
int32 | dim |
int32 | dim_offset |
NetworkNode is used to represent, three types of thing: either an input of the network (which pretty much just states the dimension of the input vector); a Component (e.g.
an affine component or a sigmoid component); or a Descriptor. A Descriptor is basically an expression that can do things like append the outputs of other components (or inputs) together, add them together, and do various other things like shifting the time index.
Each Component must have an input of type kDescriptor that is numbered Preceding to the Component, and that is not used elsewhere. This may seem unintuitive but it makes the implementation a lot easier; any apparent waste can be optimized out after compilation. And outputs must also be of type kDescriptor.
Note: in the actual computation you can provide input not only to nodes of type kInput but also to nodes of type kComponent; this is useful in things like recurrent nets where you may want to split the computation up into pieces.
Note that in the config-file format, there are three types of node: input, component and output. output maps to kDescriptor, but the nodes of type kDescriptor that represent the input to a component, are described in the same config-file line as the Component itself.
Definition at line 81 of file nnet-nnet.h.
|
inline |
Definition at line 107 of file nnet-nnet.h.
References NetworkNode::u.
Referenced by Nnet::ProcessComponentNodeConfigLine(), Nnet::ProcessDimRangeNodeConfigLine(), Nnet::ProcessInputNodeConfigLine(), and Nnet::ProcessOutputNodeConfigLine().
NetworkNode | ( | const NetworkNode & | other | ) |
Definition at line 545 of file nnet-nnet.cc.
References NetworkNode::component_index, and NetworkNode::u.
Definition at line 33 of file nnet-nnet.cc.
References NetworkNode::descriptor, NetworkNode::dim, Descriptor::Dim(), Nnet::GetComponent(), KALDI_ASSERT, KALDI_ERR, kaldi::nnet3::kComponent, kaldi::nnet3::kDescriptor, kaldi::nnet3::kDimRange, kaldi::nnet3::kInput, NetworkNode::node_type, Component::OutputDim(), and NetworkNode::u.
Referenced by Nnet::Check(), Compiler::CreateStepInfo(), SimpleForwardingDescriptor::Dim(), and Nnet::OutputDim().
int32 component_index |
Definition at line 87 of file nnet-nnet.h.
Referenced by Compiler::AddBackwardStepComponent(), ComputationGraphBuilder::AddDependencies(), Compiler::AddForwardStepComponent(), Nnet::Check(), ComputationGraphBuilder::ComputeComputableInfo(), kaldi::nnet3::ComputeComputationGraph(), Compiler::ComputeDerivNeeded(), kaldi::nnet3::FindOrphanComponents(), Nnet::GetComponentName(), Nnet::GetNode(), Compiler::GetStrideType(), SvdApplier::ModifyTopology(), NetworkNode::NetworkNode(), ModelCollapser::OptimizeNode(), Nnet::ProcessComponentNodeConfigLine(), ComputationStepsComputer::ProcessComponentStep(), ComputationGraphBuilder::PruneDependencies(), and Compiler::SetUpPrecomputedIndexes().
Descriptor descriptor |
Definition at line 84 of file nnet-nnet.h.
Referenced by ComputationGraphBuilder::AddDependencies(), Nnet::Check(), Compiler::CompileBackwardSumDescriptor(), Compiler::CompileForwardSumDescriptor(), ComputationGraphBuilder::ComputeComputableInfo(), kaldi::nnet3::ComputeComputationGraph(), Compiler::ComputeInputLocationsList(), Compiler::CreateStepInfo(), NetworkNode::Dim(), SvdApplier::ModifyTopology(), Nnet::Modulus(), kaldi::nnet3::NnetToDirectedGraph(), ModelCollapser::OptimizeNode(), Nnet::ProcessComponentNodeConfigLine(), Nnet::ProcessOutputNodeConfigLine(), and ComputationGraphBuilder::PruneDependencies().
int32 dim |
Definition at line 101 of file nnet-nnet.h.
Referenced by Nnet::Check(), Compiler::CreateStepInfo(), NetworkNode::Dim(), Nnet::InputDim(), SvdApplier::ModifyTopology(), Nnet::ProcessDimRangeNodeConfigLine(), and Nnet::ProcessInputNodeConfigLine().
int32 dim_offset |
Definition at line 103 of file nnet-nnet.h.
Referenced by Nnet::Check(), Compiler::CreateStepInfo(), SvdApplier::ModifyTopology(), and Nnet::ProcessDimRangeNodeConfigLine().
int32 node_index |
Definition at line 90 of file nnet-nnet.h.
Referenced by ComputationGraphBuilder::AddDependencies(), Nnet::Check(), ComputationGraphBuilder::ComputeComputableInfo(), kaldi::nnet3::ComputeComputationGraph(), Nnet::GetAsConfigLine(), Nnet::GetNode(), Nnet::GetNodeName(), SvdApplier::ModifyTopology(), kaldi::nnet3::NnetToDirectedGraph(), Nnet::ProcessComponentNodeConfigLine(), Nnet::ProcessDimRangeNodeConfigLine(), ComputationStepsComputer::ProcessDimRangeSubPhase(), Nnet::ProcessInputNodeConfigLine(), Nnet::ProcessOutputNodeConfigLine(), and Nnet::SetNodeName().
NodeType node_type |
Definition at line 82 of file nnet-nnet.h.
Referenced by Compiler::AddBackwardStepComponent(), ComputationGraphBuilder::AddDependencies(), Compiler::AddForwardStepComponent(), kaldi::nnet3::computation_graph::AddInputToGraph(), Nnet::Check(), Compiler::CompileBackward(), Compiler::CompileForward(), ComputationGraphBuilder::ComputeComputableInfo(), kaldi::nnet3::ComputeComputationGraph(), Compiler::CreateStepInfo(), NetworkNode::Dim(), Nnet::GetAsConfigLine(), Nnet::GetSomeNodeNames(), Nnet::InputDim(), Nnet::IsComponentInputNode(), Nnet::IsComponentNode(), Nnet::IsDescriptorNode(), Nnet::IsDimRangeNode(), Nnet::IsInputNode(), Compiler::IsInputStep(), Nnet::IsOutputNode(), SvdApplier::ModifyTopology(), Nnet::Modulus(), kaldi::nnet3::NnetToDirectedGraph(), ModelCollapser::OptimizeNode(), Nnet::ProcessDimRangeNodeConfigLine(), ComputationGraphBuilder::PruneDependencies(), and Compiler::SetUpPrecomputedIndexes().
ObjectiveType objective_type |
Definition at line 97 of file nnet-nnet.h.
Referenced by SvdApplier::ModifyTopology(), NnetComputeProb::PrintTotalStats(), Nnet::ProcessOutputNodeConfigLine(), NnetComputeProb::ProcessOutputs(), and NnetTrainer::ProcessOutputs().
union { ... } u |
Referenced by Compiler::AddBackwardStepComponent(), ComputationGraphBuilder::AddDependencies(), Compiler::AddForwardStepComponent(), Nnet::Check(), ComputationGraphBuilder::ComputeComputableInfo(), kaldi::nnet3::ComputeComputationGraph(), Compiler::ComputeDerivNeeded(), NetworkNode::Dim(), kaldi::nnet3::FindOrphanComponents(), Compiler::GetStrideType(), SvdApplier::ModifyTopology(), NetworkNode::NetworkNode(), kaldi::nnet3::NnetToDirectedGraph(), ModelCollapser::OptimizeNode(), NnetComputeProb::PrintTotalStats(), ComputationStepsComputer::ProcessComponentStep(), Nnet::ProcessDimRangeNodeConfigLine(), ComputationStepsComputer::ProcessDimRangeSubPhase(), NnetComputeProb::ProcessOutputs(), NnetTrainer::ProcessOutputs(), ComputationGraphBuilder::PruneDependencies(), and Compiler::SetUpPrecomputedIndexes().