RandomComponent Class Reference

#include <nnet-component-itf.h>

Inheritance diagram for RandomComponent:
Collaboration diagram for RandomComponent:

Public Member Functions

void ResetGenerator ()
void SetTestMode (bool test_mode)
 RandomComponent ()
 RandomComponent (const RandomComponent &other)
- Public Member Functions inherited from Component
virtual void * Propagate (const ComponentPrecomputedIndexes *indexes, const CuMatrixBase< BaseFloat > &in, CuMatrixBase< BaseFloat > *out) const =0
 Propagate function. More...
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 =0
 Backprop function; depending on which of the arguments 'to_update' and 'in_deriv' are non-NULL, this can compute input-data derivatives and/or perform model update. More...
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, the average value of the derivative of the nonlinearity. More...
virtual void ZeroStats ()
 Components that provide an implementation of StoreStats should also provide an implementation of ZeroStats(), to set those stats to zero. More...
virtual void GetInputIndexes (const MiscComputationInfo &misc_info, const Index &output_index, std::vector< Index > *desired_indexes) const
 This function only does something interesting for non-simple Components. More...
virtual bool IsComputable (const MiscComputationInfo &misc_info, const Index &output_index, const IndexSet &input_index_set, std::vector< Index > *used_inputs) const
 This function only does something interesting for non-simple Components, and it exists to make it possible to manage optionally-required inputs. More...
virtual void ReorderIndexes (std::vector< Index > *input_indexes, std::vector< Index > *output_indexes) const
 This function only does something interesting for non-simple Components. More...
virtual ComponentPrecomputedIndexesPrecomputeIndexes (const MiscComputationInfo &misc_info, const std::vector< Index > &input_indexes, const std::vector< Index > &output_indexes, bool need_backprop) const
 This function must return NULL for simple Components. More...
virtual std::string Type () const =0
 Returns a string such as "SigmoidComponent", describing the type of the object. More...
virtual void InitFromConfig (ConfigLine *cfl)=0
 Initialize, from a ConfigLine object. More...
virtual int32 InputDim () const =0
 Returns input-dimension of this component. More...
virtual int32 OutputDim () const =0
 Returns output-dimension of this component. More...
virtual int32 Properties () const =0
 Return bitmask of the component's properties. More...
virtual ComponentCopy () const =0
 Copies component (deep copy). More...
virtual void Read (std::istream &is, bool binary)=0
 Read function (used after we know the type of the Component); accepts input that is missing the token that describes the component type, in case it has already been consumed. More...
virtual void Write (std::ostream &os, bool binary) const =0
 Write component to stream. More...
virtual std::string Info () const
 Returns some text-form information about this component, for diagnostics. More...
virtual void Scale (BaseFloat scale)
 This virtual function when called on – an UpdatableComponent scales the parameters by "scale" when called by an UpdatableComponent. More...
virtual void Add (BaseFloat alpha, const Component &other)
 This virtual function when called by – an UpdatableComponent adds the parameters of another updatable component, times some constant, to the current parameters. More...
virtual void DeleteMemo (void *memo) const
 This virtual function only needs to be overwritten by Components that return a non-NULL memo from their Propagate() function. More...
virtual void ConsolidateMemory ()
 This virtual function relates to memory management, and avoiding fragmentation. More...
 Component ()
virtual ~Component ()

Protected Attributes

CuRand< BaseFloatrandom_generator_
bool test_mode_

Additional Inherited Members

- Static Public Member Functions inherited from Component
static ComponentReadNew (std::istream &is, bool binary)
 Read component from stream (works out its type). Dies on error. More...
static ComponentNewComponentOfType (const std::string &type)
 Returns a new Component of the given type e.g. More...

Detailed Description

Definition at line 405 of file nnet-component-itf.h.

Constructor & Destructor Documentation

◆ RandomComponent() [1/2]

RandomComponent ( )

Definition at line 417 of file nnet-component-itf.h.

◆ RandomComponent() [2/2]

RandomComponent ( const RandomComponent other)

Definition at line 419 of file nnet-component-itf.h.

419  :
420  test_mode_(other.test_mode_) {}

Member Function Documentation

◆ ResetGenerator()

void ResetGenerator ( )

◆ SetTestMode()

void SetTestMode ( bool  test_mode)

Definition at line 415 of file nnet-component-itf.h.

Referenced by kaldi::nnet3::SetDropoutTestMode().

415 { test_mode_ = test_mode; }

Member Data Documentation

◆ random_generator_

◆ test_mode_

The documentation for this class was generated from the following file: