Template Class Accumulator

Inheritance Relationships

Base Type

  • public BaseFactory

Class Documentation

template<class BaseFactory>
class Accumulator : public BaseFactory

Accumulator<Factory> pattern offers a shortcut to construct models or layers.

The options can be passed by a pair of parentheses. E.g., to construct a fully-connected layer:

auto hidden = mlp::dense()
   ("prefix", "hidden_layer")               // layer name
   ("dim", outDim)                          // output dimension
   ("activation", (int)mlp::act::sigmoid)   // activation function
   .construct(graph);                       // construct this layer in graph

Public Functions

Accumulator(Ptr<Options> options)
template<typename ...Args>
Accumulator(Ptr<Options> options, Args&&... moreArgs)
template<typename T, typename ...Args>
Accumulator(const std::string &key, T value, Args&&... moreArgs)
Accumulator(const Factory &factory)
Accumulator(const Accumulator&)
template<typename T>
Accumulator &operator()(const std::string &key, T value)
Accumulator &operator()(Ptr<Options> options)
Accumulator<Factory> clone()