pt_transformer: Build a piece transformer

View source: R/piece_transformer.R

pt_transformerR Documentation

Build a piece transformer

Description

Creates the model with its weights at their initial values. To run a trained one, use pt_transformer_load, which builds this and then fills it from a checkpoint.

Usage

pt_transformer(
  layout,
  d_model = 256L,
  n_heads = 8L,
  n_layers = 4L,
  ff_dim = 1024L,
  n_actions = 24L,
  activation = "relu"
)

Arguments

layout

A layout list, as pt_cube4_layout returns.

d_model

Width of the model (default 256).

n_heads

Attention heads (default 8).

n_layers

Encoder blocks (default 4).

ff_dim

Width of the feed-forward hidden layer (default 1024).

n_actions

Size of the output — one value per action (default 24).

activation

Feed-forward activation, "relu" (default) or "gelu" / "silu".

Value

A pt_transformer object.

See Also

pt_transformer_load, pt_forward


ggmlR documentation built on Oct. 23, 2026, 1:07 a.m.