NnetTrainOptions Struct Reference

#include <nnet-trnopts.h>

Collaboration diagram for NnetTrainOptions:

Public Member Functions

 NnetTrainOptions ()
 
void Register (OptionsItf *opts)
 

Public Attributes

BaseFloat learn_rate
 
BaseFloat momentum
 
BaseFloat l2_penalty
 
BaseFloat l1_penalty
 

Friends

std::ostream & operator<< (std::ostream &os, const NnetTrainOptions &opts)
 

Detailed Description

Definition at line 30 of file nnet-trnopts.h.

Constructor & Destructor Documentation

◆ NnetTrainOptions()

NnetTrainOptions ( )
inline

Definition at line 38 of file nnet-trnopts.h.

38  :
39  learn_rate(0.008),
40  momentum(0.0),
41  l2_penalty(0.0),
42  l1_penalty(0.0)
43  { }

Member Function Documentation

◆ Register()

void Register ( OptionsItf opts)
inline

Definition at line 46 of file nnet-trnopts.h.

References OptionsItf::Register().

Referenced by main().

46  {
47  opts->Register("learn-rate", &learn_rate, "Learning rate");
48  opts->Register("momentum", &momentum, "Momentum");
49  opts->Register("l2-penalty", &l2_penalty, "L2 penalty (weight decay)");
50  opts->Register("l1-penalty", &l1_penalty, "L1 penalty (promote sparsity)");
51  }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const NnetTrainOptions opts 
)
friend

Definition at line 54 of file nnet-trnopts.h.

54  {
55  os << "NnetTrainOptions : "
56  << "learn_rate" << opts.learn_rate << ", "
57  << "momentum" << opts.momentum << ", "
58  << "l2_penalty" << opts.l2_penalty << ", "
59  << "l1_penalty" << opts.l1_penalty;
60  return os;
61  }

Member Data Documentation

◆ l1_penalty

BaseFloat l1_penalty

Definition at line 35 of file nnet-trnopts.h.

Referenced by LinearTransform::Update(), and AffineTransform::Update().

◆ l2_penalty

BaseFloat l2_penalty

Definition at line 34 of file nnet-trnopts.h.

Referenced by LinearTransform::Update(), and AffineTransform::Update().

◆ learn_rate

◆ momentum


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