Skip to content

Commit

Permalink
Embedding is linear layer
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmor5 committed Aug 28, 2021
1 parent 65b0f09 commit 5431469
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/axon.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,7 @@ defmodule Axon do
Embeddings are typically used to obtain a dense representation of a sparse input
space.
"""
@doc type: :linear
def embedding(%Axon{output_shape: shape} = x, vocab_size, embedding_size, opts \\ []) do
kernel_shape = Axon.Shape.embedding_kernel(shape, vocab_size, embedding_size)
output_shape = Axon.Shape.embedding(shape, vocab_size, embedding_size)
Expand Down

0 comments on commit 5431469

Please sign in to comment.