This struct represents the structure of a convolution computation. More...
#include <convolution.h>
Classes | |
struct | ConvolutionStep |
Public Member Functions | |
void | Write (std::ostream &os, bool binary) const |
void | Read (std::istream &is, bool binary) |
void | ComputeDerived () |
void | Check () const |
Public Attributes | |
int32 | num_filters_in |
int32 | num_filters_out |
int32 | height_in |
int32 | height_out |
int32 | num_t_in |
int32 | num_t_out |
int32 | num_images |
int32 | temp_rows |
int32 | temp_cols |
std::vector< ConvolutionStep > | steps |
This struct represents the structure of a convolution computation.
This is used inside the PrecomputedIndexes object for the TimeHeightConvolutionComponent (it depends on the inputs and outputs as well as the layer).
CAUTION*: this is after certain transformations of the problem, so the height_in may not always be the "real" height of the input image (it may be a multiple thereof), and the num_t_in may not always be the "real" number of distinct time-steps on the input of the computation (it may be a divisor thereof). ConvolutionComputation contains the info needed to actually perform the computation.
Definition at line 252 of file convolution.h.
void Check | ( | ) | const |
Definition at line 349 of file convolution.cc.
References ConvolutionComputation::ConvolutionStep::backward_columns, ConvolutionComputation::ConvolutionStep::columns, ConvolutionComputation::ConvolutionStep::columns_are_contiguous, CuArrayBase< T >::CopyToVec(), CuArrayBase< T >::Dim(), ConvolutionComputation::ConvolutionStep::first_column, ConvolutionModel::height_in, ConvolutionComputation::ConvolutionStep::height_map, ConvolutionModel::height_out, rnnlm::i, ConvolutionComputation::ConvolutionStep::input_time_shift, KALDI_ASSERT, ConvolutionModel::num_filters_in, ConvolutionModel::num_filters_out, and ConvolutionComputation::ConvolutionStep::params_start_col.
Referenced by kaldi::nnet3::time_height_convolution::UnPadModelHeight().
void ComputeDerived | ( | ) |
Definition at line 1271 of file convolution.cc.
References ConvolutionComputation::ConvolutionStep::backward_columns, ConvolutionComputation::ConvolutionStep::columns, ConvolutionComputation::ConvolutionStep::columns_are_contiguous, CuArray< T >::CopyFromVec(), ConvolutionComputation::ConvolutionStep::first_column, ConvolutionModel::height_in, ConvolutionComputation::ConvolutionStep::height_map, rnnlm::i, KALDI_ASSERT, ConvolutionModel::num_filters_in, kaldi::nnet3::time_height_convolution::ReverseColumnMapping(), and kaldi::nnet3::time_height_convolution::VectorIsContiguous().
Referenced by kaldi::nnet3::time_height_convolution::UnPadModelHeight().
void Read | ( | std::istream & | is, |
bool | binary | ||
) |
Definition at line 315 of file convolution.cc.
References ConvolutionModel::Check(), ConvolutionModel::ComputeDerived(), kaldi::ExpectOneOrTwoTokens(), kaldi::nnet3::ExpectToken(), ConvolutionModel::height_in, ConvolutionComputation::ConvolutionStep::height_map, ConvolutionModel::height_out, ConvolutionComputation::ConvolutionStep::input_time_shift, ConvolutionModel::num_filters_in, ConvolutionModel::num_filters_out, ConvolutionComputation::ConvolutionStep::params_start_col, kaldi::ReadBasicType(), and kaldi::ReadIntegerVector().
Referenced by kaldi::nnet3::time_height_convolution::TestComputationIo().
void Write | ( | std::ostream & | os, |
bool | binary | ||
) | const |
Definition at line 283 of file convolution.cc.
References ConvolutionModel::height_in, ConvolutionComputation::ConvolutionStep::height_map, ConvolutionModel::height_out, ConvolutionComputation::ConvolutionStep::input_time_shift, ConvolutionModel::num_filters_in, ConvolutionModel::num_filters_out, ConvolutionComputation::ConvolutionStep::params_start_col, kaldi::WriteBasicType(), kaldi::WriteIntegerVector(), and kaldi::WriteToken().
Referenced by kaldi::nnet3::time_height_convolution::TestComputationIo().
int32 height_in |
Definition at line 257 of file convolution.h.
Referenced by kaldi::nnet3::time_height_convolution::ComputeTempMatrixSize(), kaldi::nnet3::time_height_convolution::ConvolveBackwardData(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParams(), kaldi::nnet3::time_height_convolution::ConvolveForward(), kaldi::nnet3::time_height_convolution::MakeComputation(), and kaldi::nnet3::time_height_convolution::UnPadModelHeight().
int32 height_out |
Definition at line 257 of file convolution.h.
Referenced by kaldi::nnet3::time_height_convolution::ConvolveBackwardData(), kaldi::nnet3::time_height_convolution::ConvolveBackwardDataInternal(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParams(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParamsInternal(), kaldi::nnet3::time_height_convolution::ConvolveForward(), kaldi::nnet3::time_height_convolution::ConvolveForwardInternal(), kaldi::nnet3::time_height_convolution::MakeComputation(), and kaldi::nnet3::time_height_convolution::UnPadModelHeight().
int32 num_filters_in |
Definition at line 254 of file convolution.h.
Referenced by kaldi::nnet3::time_height_convolution::ComputeTempMatrixSize(), kaldi::nnet3::time_height_convolution::ConvolveBackwardData(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParams(), kaldi::nnet3::time_height_convolution::ConvolveForward(), and kaldi::nnet3::time_height_convolution::MakeComputation().
int32 num_filters_out |
Definition at line 254 of file convolution.h.
Referenced by kaldi::nnet3::time_height_convolution::ConvolveBackwardData(), kaldi::nnet3::time_height_convolution::ConvolveBackwardDataInternal(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParams(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParamsInternal(), kaldi::nnet3::time_height_convolution::ConvolveForward(), kaldi::nnet3::time_height_convolution::ConvolveForwardInternal(), and kaldi::nnet3::time_height_convolution::MakeComputation().
int32 num_images |
Definition at line 267 of file convolution.h.
Referenced by kaldi::nnet3::time_height_convolution::ComputeTempMatrixSize(), kaldi::nnet3::time_height_convolution::ConvolveBackwardData(), kaldi::nnet3::time_height_convolution::ConvolveBackwardDataInternal(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParams(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParamsInternal(), kaldi::nnet3::time_height_convolution::ConvolveForward(), kaldi::nnet3::time_height_convolution::ConvolveForwardInternal(), and kaldi::nnet3::time_height_convolution::MakeComputation().
int32 num_t_in |
Definition at line 263 of file convolution.h.
Referenced by kaldi::nnet3::time_height_convolution::ConvolveBackwardData(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParams(), kaldi::nnet3::time_height_convolution::ConvolveForward(), and kaldi::nnet3::time_height_convolution::MakeComputation().
int32 num_t_out |
Definition at line 263 of file convolution.h.
Referenced by kaldi::nnet3::time_height_convolution::ComputeTempMatrixSize(), kaldi::nnet3::time_height_convolution::ConvolveBackwardData(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParams(), kaldi::nnet3::time_height_convolution::ConvolveForward(), and kaldi::nnet3::time_height_convolution::MakeComputation().
std::vector<ConvolutionStep> steps |
Definition at line 343 of file convolution.h.
Referenced by kaldi::nnet3::time_height_convolution::ComputeTempMatrixSize(), kaldi::nnet3::time_height_convolution::ConvolveBackwardDataInternal(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParamsInternal(), kaldi::nnet3::time_height_convolution::ConvolveForwardInternal(), kaldi::nnet3::time_height_convolution::MakeComputation(), and kaldi::nnet3::time_height_convolution::UnPadModelHeight().
int32 temp_cols |
Definition at line 282 of file convolution.h.
Referenced by kaldi::nnet3::time_height_convolution::ComputeTempMatrixSize(), kaldi::nnet3::time_height_convolution::ConvolveBackwardData(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParams(), and kaldi::nnet3::time_height_convolution::ConvolveForward().
int32 temp_rows |
Definition at line 282 of file convolution.h.
Referenced by kaldi::nnet3::time_height_convolution::ComputeTempMatrixSize(), kaldi::nnet3::time_height_convolution::ConvolveBackwardData(), kaldi::nnet3::time_height_convolution::ConvolveBackwardParams(), and kaldi::nnet3::time_height_convolution::ConvolveForward().