Bumblebee.ModelSpec behaviour (Bumblebee v0.7.0)

View Source

An interface for configuring and building models based on the same architecture.

Every module implementing this behaviour is expected to also define a configuration struct.

Summary

Callbacks

Returns the list of supported model architectures.

Builds a template input for the model.

Builds an Axon model according to the given configuration.

Types

t()

@type t() :: Bumblebee.Configurable.t()

Callbacks

architectures()

@callback architectures() :: [atom()]

Returns the list of supported model architectures.

input_template(t)

@callback input_template(t()) :: map()

Builds a template input for the model.

The template is used to compile the model when initializing parameters.

model(t)

@callback model(t()) :: Axon.t()

Builds an Axon model according to the given configuration.