Class MLP

Inheritance Relationships

Base Types

Class Documentation

class MLP : public marian::IUnaryLogitLayer, public marian::IHasShortList

Multi-layer network, holds and applies layers.

Public Functions

MLP(Ptr<ExpressionGraph> graph, Ptr<Options> options)

Construct a MLP container in the graph.

Parameters
  • graph: The expression graph.

  • options: The options used for this mlp container.

Expr apply(const std::vector<Expr> &av)

Apply/Link a vector of mlp layers (with the given inputs) to the expression graph.

Return

The expression holding the mlp container

Parameters
  • av: The vector of input expressions

Logits applyAsLogits(const std::vector<Expr> &av)

Apply/Link a vector of mlp layers (with the given inputs) to the expression graph.

Return

The expression holding the mlp container as a Logits object

Parameters
  • av: The vector of input expressions

Expr apply(Expr e)

Apply/Link a mlp layer (with the given input) to the expression graph.

Return

The expression holding the mlp container

Parameters
  • e: The input expression

Logits applyAsLogits(Expr e)

Apply/Link a mlp layer (with the given input) to the expression graph.

Return

The expression holding the mlp container as a Logits object

Parameters
  • e: The input expression

void push_back(Ptr<IUnaryLayer> layer)

Stack a mlp layer to the mlp container.

Parameters
  • layer: The mlp layer

void push_back(Ptr<IUnaryLogitLayer> layer)

Stack a mlp layer with Logits object to the mlp container.

Parameters
  • layer: The mlp layer with Logits object

void setShortlist(Ptr<data::Shortlist> shortlist)

Set shortlisted words to the mlp container.

Parameters
  • shortlist: The given shortlisted words

void clear()

Remove shortlisted words from the mlp container.

Protected Attributes

Ptr<ExpressionGraph> graph_
Ptr<Options> options_
std::vector<Ptr<IUnaryLayer>> layers_