Contents

class

SushiAI::NN::Sequential

template <typename... Ls>

Applies layers in sequence and indexes parameter paths.

Declared in
include/SushiAI/nn/layers.hpp

Template parameters

Ls

Layer types in forward application order.

Public member functions

explicit constexpr Sequential(Ls... layers)

Constructs from the layers themselves.

Parameters

layers

The layers, in application order; moved in.

Graph::ValueId forward(const Graph::GraphBuilder &builder, Graph::ValueId x)

Traces every layer in order.

Parameters

builder

Where the nodes go.

x

The input value.

Returns

The last layer's result.

template <typename Fn>
void visit_children(Fn &&visitor)

Applies visitor to each child with its index.

Parameters

visitor

Called as visitor(std::size_t index, Layer& child).

template <std::size_t Index>
auto & layer() noexcept

Direct access to the Index-th layer.

Static public member functions

static constexpr auto fields()

No parameters of its own; the children own them all.

static constexpr std::size_t size() noexcept

How many layers this container holds.