26 #ifndef KALDI_NNET3_NNET_SIMPLE_COMPONENT_H_ 27 #define KALDI_NNET3_NNET_SIMPLE_COMPONENT_H_ 52 Init(input_dim, output_dim);
58 virtual std::string
Type()
const {
return "PnormComponent"; }
65 virtual void Backprop(
const std::string &debug_info,
76 virtual void Read(std::istream &is,
bool binary);
80 virtual void Write(std::ostream &os,
bool binary)
const;
95 bool dropout_per_frame =
false);
98 bool dropout_per_frame =
false) {
99 Init(dim, dropout, dropout_per_frame);
103 dropout_per_frame_(false) { }
111 virtual std::string
Type()
const {
return "DropoutComponent"; }
119 virtual void Read(std::istream &is,
bool binary);
122 virtual void Write(std::ostream &os,
bool binary)
const;
127 virtual void Backprop(
const std::string &debug_info,
138 virtual std::string
Info()
const;
141 dropout_proportion_ = dropout_proportion;
157 Init(input_dim, output_dim);
163 virtual std::string
Type()
const {
return "ElementwiseProductComponent"; }
170 virtual void Backprop(
const std::string &debug_info,
181 virtual void Read(std::istream &is,
bool binary);
185 virtual void Write(std::ostream &os,
bool binary)
const;
226 virtual std::string
Type()
const {
return "SigmoidComponent"; }
234 virtual void Backprop(
const std::string &debug_info,
286 virtual std::string
Type()
const {
return "TanhComponent"; }
294 virtual void Backprop(
const std::string &debug_info,
349 virtual std::string
Type()
const {
return "RectifiedLinearComponent"; }
358 virtual void Backprop(
const std::string &debug_info,
413 virtual std::string
Info()
const;
417 virtual std::string
Type()
const {
return "AffineComponent"; }
427 virtual void Backprop(
const std::string &debug_info,
436 virtual void Read(std::istream &is,
bool binary);
437 virtual void Write(std::ostream &os,
bool binary)
const;
466 virtual void Resize(
int32 input_dim,
int32 output_dim);
471 void Init(std::string matrix_filename);
477 const std::string &debug_info,
480 UpdateSimple(in_value, out_deriv);
484 virtual void UpdateSimple(
507 virtual int32 InputDim()
const {
return linear_params_.NumCols() * num_blocks_; }
510 virtual std::string
Info()
const;
514 virtual std::string
Type()
const {
return "BlockAffineComponent"; }
524 virtual void Backprop(
const std::string &debug_info,
533 virtual void Read(std::istream &is,
bool binary);
534 virtual void Write(std::ostream &os,
bool binary)
const;
573 virtual int32 InputDim()
const {
return linear_params_.NumCols() * num_repeats_; }
574 virtual int32 OutputDim()
const {
return linear_params_.NumRows() * num_repeats_; }
576 virtual std::string
Info()
const;
580 virtual std::string
Type()
const {
return "RepeatedAffineComponent"; }
588 virtual void Backprop(
const std::string &debug_info,
597 virtual void Read(std::istream &is,
bool binary);
598 virtual void Write(std::ostream &os,
bool binary)
const;
644 virtual std::string
Type()
const {
645 return "NaturalGradientRepeatedAffineComponent";
665 virtual void SetNaturalGradientConfigs();
682 virtual std::string
Type()
const {
return "SoftmaxComponent"; }
690 virtual void Backprop(
const std::string &debug_info,
724 virtual std::string
Type()
const {
return "LogSoftmaxComponent"; }
731 virtual void Backprop(
const std::string &debug_info,
827 virtual std::string
Type()
const {
return "NaturalGradientAffineComponent"; }
828 virtual void Read(std::istream &is,
bool binary);
829 virtual void Write(std::ostream &os,
bool binary)
const;
833 virtual std::string
Info()
const;
857 const std::string &debug_info,
932 virtual std::string
Type()
const {
return "LinearComponent"; }
941 virtual void Backprop(
const std::string &debug_info,
949 virtual void Read(std::istream &is,
bool binary);
950 virtual void Write(std::ostream &os,
bool binary)
const;
954 virtual std::string
Info()
const;
995 virtual std::string
Type()
const {
return "FixedAffineComponent"; }
996 virtual std::string
Info()
const;
1017 virtual void Backprop(
const std::string &debug_info,
1028 virtual void Read(std::istream &is,
bool binary);
1029 virtual void Write(std::ostream &os,
bool binary)
const;
1057 void Init(
const std::vector<int32> &sizes);
1060 void GetSizes(std::vector<int32> *sizes)
const;
1065 virtual std::string
Type()
const {
return "SumGroupComponent"; }
1070 virtual void Backprop(
const std::string &debug_info,
1079 virtual void Read(std::istream &is,
bool binary);
1080 virtual void Write(std::ostream &os,
bool binary)
const;
1100 virtual std::string
Type()
const {
return "FixedScaleComponent"; }
1101 virtual std::string
Info()
const;
1118 virtual void Backprop(
const std::string &debug_info,
1127 virtual void Read(std::istream &is,
bool binary);
1128 virtual void Write(std::ostream &os,
bool binary)
const;
1143 virtual std::string
Type()
const {
return "FixedBiasComponent"; }
1144 virtual std::string
Info()
const;
1161 virtual void Backprop(
const std::string &debug_info,
1170 virtual void Read(std::istream &is,
bool binary);
1171 virtual void Write(std::ostream &os,
bool binary)
const;
1189 dim_(other.dim_), backprop_scale_(other.backprop_scale_) { }
1191 virtual std::string
Type()
const {
return "NoOpComponent"; }
1199 virtual void Read(std::istream &is,
bool binary);
1200 virtual void Write(std::ostream &os,
bool binary)
const;
1201 virtual std::string
Info()
const;
1206 virtual void Backprop(
const std::string &debug_info,
1239 virtual std::string
Type()
const {
return "SumBlockComponent"; }
1246 virtual void Read(std::istream &is,
bool binary);
1247 virtual void Write(std::ostream &os,
bool binary)
const;
1248 virtual std::string
Info()
const;
1253 virtual void Backprop(
const std::string &debug_info,
1297 bool norm_based_clipping,
1298 BaseFloat self_repair_clipped_proportion_threshold,
1303 int32 num_self_repaired,
1304 int32 num_backpropped) {
1305 Init(dim, clipping_threshold, norm_based_clipping,
1306 self_repair_clipped_proportion_threshold,
1310 num_self_repaired, num_backpropped);}
1313 norm_based_clipping_(false),
1314 self_repair_clipped_proportion_threshold_(1.0),
1315 self_repair_target_(0.0),
1316 self_repair_scale_(0.0),
1317 num_clipped_(0), count_(0),
1318 num_self_repaired_(0), num_backpropped_(0) { }
1324 BaseFloat self_repair_clipped_proportion_threshold,
1328 int32 num_self_repaired,
int32 num_backpropped);
1330 virtual std::string
Type()
const {
return "ClipGradientComponent"; }
1341 clipping_threshold_,
1342 norm_based_clipping_,
1343 self_repair_clipped_proportion_threshold_,
1344 self_repair_target_,
1354 virtual void Backprop(
const std::string &debug_info,
1365 virtual void Read(std::istream &is,
bool binary);
1368 virtual void Write(std::ostream &os,
bool binary)
const;
1369 virtual std::string
Info()
const;
1371 if (num_self_repaired_ > 0)
1372 KALDI_LOG <<
"ClipGradientComponent(node_name=" << debug_info_
1373 <<
")'s self-repair was activated " << num_self_repaired_
1374 <<
" time(s) out of " << num_backpropped_
1375 <<
" times of calling Backprop() in this training job.";
1406 void RepairGradients(
const std::string &debug_info,
1448 void Init(
const std::vector<int32> &column_map);
1450 virtual std::string
Type()
const {
return "PermuteComponent"; }
1463 virtual void Backprop(
const std::string &debug_info,
1474 virtual void Read(std::istream &is,
bool binary);
1477 virtual void Write(std::ostream &os,
bool binary)
const;
1478 virtual std::string
Info()
const;
1482 void ComputeReverseColumnMap();
1518 virtual std::string
Info()
const;
1522 virtual std::string
Type()
const {
return "PerElementScaleComponent"; }
1531 virtual void Backprop(
const std::string &debug_info,
1540 virtual void Read(std::istream &is,
bool binary);
1541 virtual void Write(std::ostream &os,
bool binary)
const;
1559 void Init(std::string vector_filename);
1565 const std::string &debug_info,
1568 UpdateSimple(in_value, out_deriv);
1572 virtual void UpdateSimple(
1620 virtual std::string
Info()
const;
1624 virtual std::string
Type()
const {
return "PerElementOffsetComponent"; }
1634 virtual void Backprop(
const std::string &debug_info,
1643 virtual void Read(std::istream &is,
bool binary);
1644 virtual void Write(std::ostream &os,
bool binary)
const;
1684 virtual std::string
Info()
const;
1694 virtual std::string
Type()
const {
return "ConstantFunctionComponent"; }
1704 virtual void Backprop(
const std::string &debug_info,
1713 virtual void Read(std::istream &is,
bool binary);
1714 virtual void Write(std::ostream &os,
bool binary)
const;
1769 virtual std::string
Info()
const;
1775 return "NaturalGradientPerElementScaleComponent";
1778 virtual void Read(std::istream &is,
bool binary);
1779 virtual void Write(std::ostream &os,
bool binary)
const;
1791 void Init(std::string vector_filename,
1808 virtual void Update(
1809 const std::string &debug_info,
1858 virtual std::string
Info()
const;
1862 virtual std::string
Type()
const {
return "ScaleAndOffsetComponent"; }
1873 (dim_ != scales_.Dim() ?
1879 virtual void Backprop(
const std::string &debug_info,
1888 virtual void Read(std::istream &is,
bool binary);
1889 virtual void Write(std::ostream &os,
bool binary)
const;
1914 void BackpropInternal(
const std::string &debug_info,
1925 const std::string &debug_info,
1976 virtual std::string
Info()
const;
1985 void Init(
const std::vector<Component*> &components,
1986 int32 max_rows_process);
1988 virtual std::string
Type()
const {
return "CompositeComponent"; }
2001 virtual void Backprop(
const std::string &debug_info,
2015 virtual void Read(std::istream &is,
bool binary);
2016 virtual void Write(std::ostream &os,
bool binary)
const;
2021 virtual void SetUnderlyingLearningRate(
BaseFloat lrate);
2022 virtual void SetActualLearningRate(
BaseFloat lrate);
2023 virtual void SetAsGradient();
2058 bool IsUpdatable()
const;
CuVector< BaseFloat > offsets_
CuVector< BaseFloat > scales_
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual void Update(const std::string &debug_info, const CuMatrixBase< BaseFloat > &in_value, const CuMatrixBase< BaseFloat > &out_deriv)
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
PerElementOffsetComponent()
virtual int32 OutputDim() const
Returns output-dimension of this component.
BaseFloat self_repair_target_
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
OnlineNaturalGradient preconditioner_
virtual void ZeroStats()
Components that provide an implementation of StoreStats should also provide an implementation of Zero...
OnlineNaturalGradient preconditioner_out_
bool use_natural_gradient_
virtual Component * Copy() const
Copies component (deep copy).
virtual Component * Copy() const
Copies component (deep copy).
virtual int32 Properties() const
Return bitmask of the component's properties.
void SetDropoutProportion(BaseFloat dropout_proportion)
void DeletePointers(std::vector< A *> *v)
Deletes any non-NULL pointers in the vector v, and sets the corresponding entries of v to NULL...
virtual int32 OutputDim() const
Returns output-dimension of this component.
virtual void * Propagate(const ComponentPrecomputedIndexes *indexes, const CuMatrixBase< BaseFloat > &in, CuMatrixBase< BaseFloat > *out) const =0
Propagate function.
virtual void Write(std::ostream &os, bool binary) const
Write component to stream.
virtual int32 OutputDim() const
Returns output-dimension of this component.
virtual int32 InputDim() const
Returns input-dimension of this component.
CuVector< BaseFloat > bias_params_
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual int32 Properties() const
Return bitmask of the component's properties.
OnlineNaturalGradient preconditioner_
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual int32 InputDim() const
Returns input-dimension of this component.
CuMatrix< BaseFloat > linear_params_
const CuVector< BaseFloat > & BiasParams() const
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual int32 InputDim() const
Returns input-dimension of this component.
Abstract base-class for neural-net components.
virtual Component * Copy() const
Copies component (deep copy).
virtual int32 Properties() const
Return bitmask of the component's properties.
bool use_natural_gradient_
CuVector< BaseFloat > bias_params_
virtual int32 InputDim() const
Returns input-dimension of this component.
virtual int32 Properties() const
Return bitmask of the component's properties.
CuMatrix< BaseFloat > linear_params_
BaseFloat backprop_scale_
CuVector< BaseFloat > offsets_
ClipGradientComponent(int32 dim, BaseFloat clipping_threshold, bool norm_based_clipping, BaseFloat self_repair_clipped_proportion_threshold, BaseFloat self_repair_target, BaseFloat self_repair_scale, int32 num_clipped, int32 count, int32 num_self_repaired, int32 num_backpropped)
virtual void Add(BaseFloat alpha, const Component &other)
This virtual function when called by – an UpdatableComponent adds the parameters of another updatabl...
virtual void Scale(BaseFloat scale)
This virtual function when called on – an UpdatableComponent scales the parameters by "scale" when c...
bool use_natural_gradient_
virtual int32 InputDim() const
Returns input-dimension of this component.
virtual void InitFromConfig(ConfigLine *cfl)
Initialize, from a ConfigLine object.
virtual int32 OutputDim() const
Returns output-dimension of this component.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
BaseFloat Epsilon() const
virtual int32 InputDim() const
Returns input-dimension of this component.
Keywords for search: natural gradient, naturalgradient, NG-SGD.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
LogSoftmaxComponent(const LogSoftmaxComponent &other)
This class represents a matrix that's stored on the GPU if we have one, and in memory if not...
const CuMatrix< BaseFloat > & LinearParams() const
virtual int32 InputDim() const
Returns input-dimension of this component.
virtual void Read(std::istream &is, bool binary)
Read function (used after we know the type of the Component); accepts input that is missing the token...
virtual int32 OutputDim() const
Returns output-dimension of this component.
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual int32 InputDim() const
Returns input-dimension of this component.
PermuteComponent changes the order of the columns (i.e.
CuVector< BaseFloat > bias_params_
virtual Component * Copy() const
Copies component (deep copy).
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual int32 InputDim() const
Returns input-dimension of this component.
CuVector< BaseFloat > bias_
PermuteComponent(const std::vector< int32 > &column_map)
CompositeComponent is a component representing a sequence of [simple] components. ...
void Init(int32 input_dim, int32 output_dim)
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
RectifiedLinearComponent(const RectifiedLinearComponent &other)
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual void SetNaturalGradientConfigs()
virtual int32 Properties() const
Return bitmask of the component's properties.
BaseFloat self_repair_clipped_proportion_threshold_
virtual int32 Properties() const
Return bitmask of the component's properties.
FixedScaleComponent applies a fixed per-element scale; it's similar to the Rescale component in the n...
virtual Component * Copy() const
Copies component (deep copy).
OnlineNaturalGradient preconditioner_in_
BaseFloat self_repair_scale_
virtual Component * Copy() const
Copies component (deep copy).
virtual int32 OutputDim() const
Returns output-dimension of this component.
BaseFloat DropoutProportion() const
NaturalGradientRepeatedAffineComponent()
CuArray< Int32Pair > indexes_
BaseFloat clipping_threshold_
void FreezeNaturalGradient(bool freeze, Nnet *nnet)
Controls if natural gradient will be updated.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
OnlineNaturalGradient preconditioner_in_
CuArray< int32 > column_map_
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
virtual int32 InputDim() const
Returns input-dimension of this component.
NaturalGradientPerElementScaleComponent is like PerElementScaleComponent but it uses a natural gradie...
virtual void Scale(BaseFloat scale)
This virtual function when called on – an UpdatableComponent scales the parameters by "scale" when c...
virtual int32 Properties() const
Return bitmask of the component's properties.
int32 NumParameters(const Nnet &src)
Returns the total of the number of parameters in the updatable components of the nnet.
virtual int32 InputDim() const
Returns input-dimension of this component.
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual int32 OutputDim() const
Returns output-dimension of this component.
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual void * Propagate(const ComponentPrecomputedIndexes *indexes, const CuMatrixBase< BaseFloat > &in, CuMatrixBase< BaseFloat > *out) const
Propagate function.
BaseFloat OrthonormalConstraint() const
virtual ~ClipGradientComponent()
virtual void ZeroStats()
Components that provide an implementation of StoreStats should also provide an implementation of Zero...
virtual int32 InputDim() const
Returns input-dimension of this component.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
virtual void StoreStats(const CuMatrixBase< BaseFloat > &in_value, const CuMatrixBase< BaseFloat > &out_value, void *memo)
This function may store stats on average activation values, and for some component types...
PerElementScaleComponent()
const CuVector< BaseFloat > & BiasParams() const
BaseFloat orthonormal_constraint_
virtual Component * Copy() const
Copies component (deep copy).
virtual int32 OutputDim() const
Returns output-dimension of this component.
CuMatrixBase< BaseFloat > & Params()
SumGroupComponent is used to sum up groups of posteriors.
const CuMatrixBase< BaseFloat > & Params() const
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
CuArray< int32 > reverse_column_map_
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual int32 OutputDim() const
Returns output-dimension of this component.
std::vector< Component * > components_
SigmoidComponent(const SigmoidComponent &other)
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
const CuMatrix< BaseFloat > & LinearParams() const
virtual int32 InputDim() const
Returns input-dimension of this component.
virtual Component * Copy() const
Copies component (deep copy).
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
BaseFloat DotProduct(const Nnet &nnet1, const Nnet &nnet2)
Returns dot product between two networks of the same structure (calls the DotProduct functions of the...
virtual Component * Copy() const
Copies component (deep copy).
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
virtual int32 Properties() const
Return bitmask of the component's properties.
SoftmaxComponent(const SoftmaxComponent &other)
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
TanhComponent(const TanhComponent &other)
int32 NumComponents() const
Class UpdatableComponent is a Component which has trainable parameters; it extends the interface of C...
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
RepeatedAffineComponent()
virtual int32 OutputDim() const
Returns output-dimension of this component.
virtual Component * Copy() const
Copies component (deep copy).
bool norm_based_clipping_
CuMatrix< BaseFloat > linear_params_
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
virtual int32 OutputDim() const
Returns output-dimension of this component.
virtual int32 InputDim() const
Returns input-dimension of this component.
virtual int32 Properties() const
Return bitmask of the component's properties.
OnlineNaturalGradient preconditioner_
CuMatrix< BaseFloat > params_
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
Matrix for CUDA computing.
CuMatrix< BaseFloat > & LinearParams()
virtual int32 OutputDim() const
Returns output-dimension of this component.
CuArray< int32 > reverse_indexes_
KALDI_DISALLOW_COPY_AND_ASSIGN(Component)
virtual int32 OutputDim() const
Returns output-dimension of this component.
This class is responsible for parsing input like hi-there xx=yyy a=b c empty= f-oo=Append(bar, sss) ba_z=123 bing='a b c' baz="a b c d='a b' e" and giving you access to the fields, in this case.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
PerElementScaleComponent scales each dimension of its input with a separate trainable scale; it's lik...
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual void Update(const std::string &debug_info, const CuMatrixBase< BaseFloat > &in_value, const CuMatrixBase< BaseFloat > &out_deriv)
SumBlockComponent sums over blocks of its input: for instance, if you create one with the config "inp...
virtual Component * Copy()
virtual void ConsolidateMemory()
This virtual function relates to memory management, and avoiding fragmentation.
RectifiedLinearComponent()
const CuVector< BaseFloat > & BiasParams() const
FixedBiasComponent applies a fixed per-element bias; it's similar to the AddShift component in the nn...
CuVector< BaseFloat > scales_
NoOpComponent just duplicates its input.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
BaseFloat OrthonormalConstraint() const
virtual void Backprop(const std::string &debug_info, const ComponentPrecomputedIndexes *indexes, const CuMatrixBase< BaseFloat > &in_value, const CuMatrixBase< BaseFloat > &out_value, const CuMatrixBase< BaseFloat > &out_deriv, void *memo, Component *to_update, CuMatrixBase< BaseFloat > *in_deriv) const
Backprop function; depending on which of the arguments 'to_update' and 'in_deriv' are non-NULL...
void PerturbParams(BaseFloat stddev, Nnet *nnet)
Calls PerturbParams (with the given stddev) on all updatable components of the nnet.
CuMatrix< BaseFloat > linear_params_
OnlineNaturalGradient offset_preconditioner_
virtual int32 Properties() const
Return bitmask of the component's properties.
virtual std::string Info() const
Returns some text-form information about this component, for diagnostics.
virtual int32 OutputDim() const
Returns output-dimension of this component.
ElementwiseProductComponent(int32 input_dim, int32 output_dim)
ElementwiseProductComponent()
NoOpComponent(const NoOpComponent &other)
BaseFloat orthonormal_constraint_
virtual int32 OutputDim() const
Returns output-dimension of this component.
NaturalGradientPerElementScaleComponent()
PnormComponent(int32 input_dim, int32 output_dim)
virtual int32 InputDim() const
Returns input-dimension of this component.
OnlineNaturalGradient scale_preconditioner_
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
virtual ~CompositeComponent()
virtual int32 OutputDim() const
Returns output-dimension of this component.
virtual int32 InputDim() const
Returns input-dimension of this component.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
Provides a vector abstraction class.
CuVector< BaseFloat > scales_
virtual int32 InputDim() const
Returns input-dimension of this component.
virtual void Add(BaseFloat alpha, const Component &other)
This virtual function when called by – an UpdatableComponent adds the parameters of another updatabl...
bool use_natural_gradient_
virtual int32 NumParameters() const
The following new virtual function returns the total dimension of the parameters in this class...
virtual int32 OutputDim() const
Returns output-dimension of this component.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
OnlineNaturalGradient preconditioner_out_
virtual int32 Properties() const
Return bitmask of the component's properties.
DropoutComponent(int32 dim, BaseFloat dropout=0.0, bool dropout_per_frame=false)
virtual Component * Copy() const
Copies component (deep copy).
NaturalGradientAffineComponent()
const CuMatrix< BaseFloat > & LinearParams() const
virtual int32 InputDim() const
Returns input-dimension of this component.
BaseFloat dropout_proportion_
dropout-proportion is the proportion that is dropped out, e.g.
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
CuVector< BaseFloat > bias_params_
const CuVector< BaseFloat > & Scales() const
ScaleAndOffsetComponent()
CuVector< BaseFloat > & BiasParams()
virtual std::string Type() const
Returns a string such as "SigmoidComponent", describing the type of the object.
OnlineNaturalGradient preconditioner_in_
Vector for CUDA computing.
virtual int32 OutputDim() const
Returns output-dimension of this component.
virtual int32 OutputDim() const
Returns output-dimension of this component.
CuVector< BaseFloat > output_
virtual int32 Properties() const
Return bitmask of the component's properties.
FixedAffineComponent is an affine transform that is supplied at network initialization time and is no...
virtual int32 InputDim() const
Returns input-dimension of this component.
This class implements an affine transform using a block diagonal matrix e.g., one whose weight matrix...