RandomComponent Class Reference

#include <nnet-component.h>

Inheritance diagram for RandomComponent:
Collaboration diagram for RandomComponent:

Public Member Functions

void ResetGenerator ()
 
- Public Member Functions inherited from Component
 Component ()
 
virtual std::string Type () const =0
 
virtual int32 Index () const
 Returns the index in the sequence of layers in the neural net; intended only to be used in debugging information. More...
 
virtual void SetIndex (int32 index)
 
virtual void InitFromString (std::string args)=0
 Initialize, typically from a line of a config file. More...
 
virtual int32 InputDim () const =0
 Get size of input vectors. More...
 
virtual int32 OutputDim () const =0
 Get size of output vectors. More...
 
virtual std::vector< int32Context () const
 Return a vector describing the temporal context this component requires for each frame of output, as a sorted list. More...
 
virtual void Propagate (const ChunkInfo &in_info, const ChunkInfo &out_info, const CuMatrixBase< BaseFloat > &in, CuMatrixBase< BaseFloat > *out) const =0
 Perform forward pass propagation Input->Output. More...
 
void Propagate (const ChunkInfo &in_info, const ChunkInfo &out_info, const CuMatrixBase< BaseFloat > &in, CuMatrix< BaseFloat > *out) const
 A non-virtual propagate function that first resizes output if necessary. More...
 
virtual void Backprop (const ChunkInfo &in_info, const ChunkInfo &out_info, const CuMatrixBase< BaseFloat > &in_value, const CuMatrixBase< BaseFloat > &out_value, const CuMatrixBase< BaseFloat > &out_deriv, Component *to_update, CuMatrix< BaseFloat > *in_deriv) const =0
 Perform backward pass propagation of the derivative, and also either update the model (if to_update == this) or update another model or compute the model derivative (otherwise). More...
 
virtual bool BackpropNeedsInput () const
 
virtual bool BackpropNeedsOutput () const
 
virtual ComponentCopy () const =0
 Copy component (deep copy). More...
 
virtual void Read (std::istream &is, bool binary)=0
 
virtual void Write (std::ostream &os, bool binary) const =0
 Write component to stream. More...
 
virtual std::string Info () const
 
virtual ~Component ()
 

Protected Attributes

CuRand< BaseFloatrandom_generator_
 

Additional Inherited Members

- Static Public Member Functions inherited from Component
static ComponentReadNew (std::istream &is, bool binary)
 Read component from stream. More...
 
static ComponentNewFromString (const std::string &initializer_line)
 Initialize the Component from one line that will contain first the type, e.g. More...
 
static ComponentNewComponentOfType (const std::string &type)
 Return a new Component of the given type e.g. More...
 

Detailed Description

Definition at line 1080 of file nnet-component.h.

Member Function Documentation

◆ ResetGenerator()

void ResetGenerator ( )
inline

Definition at line 1086 of file nnet-component.h.

Referenced by Nnet::ResetGenerators(), and kaldi::nnet2::UnitTestGenericComponentInternal().

1086 { random_generator_.SeedGpu(); }
CuRand< BaseFloat > random_generator_

Member Data Documentation

◆ random_generator_

CuRand<BaseFloat> random_generator_
protected

Definition at line 1088 of file nnet-component.h.


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