Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/axon.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,13 @@ defmodule Axon do
`kernel` and `bias` are layer parameters. `units` specifies the
number of output units.

The input may have any rank of at least 2. The kernel has shape
`{last_input_dim, units}` and is applied along the last axis, so an
input of shape `{batch, positions, features}` produces an output of
shape `{batch, positions, units}` with the same kernel and bias shared
across the positions. This is how a per-timestep linear layer over a
sequence is built.

Compiles to `Axon.Layers.dense/4`.

## Options
Expand Down
2 changes: 1 addition & 1 deletion test/axon/loop_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ defmodule Axon.LoopTest do
|> Loop.run(data, Axon.ModelState.empty())
end
end

test "logs epoch and iteration" do
model = Axon.input("input", shape: {nil, 1}) |> Axon.dense(1)
data = [{Nx.tensor([[1.0]]), Nx.tensor([[2.0]])}]
Expand Down
Loading