I am trying to make a word embedding layer in a flux model in Julia and I am using this tutorial as a reference https://spcman.github.io/getting-to-know-julia/deep-learning/nlp/flux-embeddings-tutorial-1/.
I believe it is a bit outdated but I was unable to find any other tutorials for making a word embedding layer in Flux. The line that was giving me trouble is (m::EmbeddingLayer)(x) = m.W * Flux.onehotbatch(reshape(x, pad_size*N), 0:vocab_size-1)
. Every time it runs I get the error ERROR: MethodError: no method matching *(::Zygote.Params{Zygote.Buffer{Any, Vector{Any}}}, ::Flux.OneHotArray{UInt32, 20, 1, 2, Vector{UInt32}})
.
Please let me know how I can fix this error or if there is a better tutorial or method that I should follow to create a word embedding layer in Julia.
Thanks,
Jack