JuliaText / JuliaText/TextModels.jl

Expected param size (1150, 1) got (1150,) (BinSentimentClassifier)

Open
#35 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
30
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Multiple issues with this one. Line 34 has `SentimentClassifier` which isn't defined anywhere which should be `BinSentimentClassifier`.
Moreover TextModels does not include the `sentiment.jl` file where `BinSentimentClassifier` is defined.
And then running this:

```
julia> using TextModels.ULMFiT

julia> c = ULMFiT.BinSentimentClassifier()
ERROR: Expected param size (1150, 1), got (1150,)
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:33
[2] loadparams!(m::TextModels.ULMFiT.BinSentimentClassifier, xs::Vector{Any})
@ Flux C:\Users\Admin\.julia\packages\Flux\BPPNj\src\functor.jl:59
[3] TextModels.ULMFiT.BinSentimentClassifier()
@ TextModels.ULMFiT C:\Users\Admin\Desktop\work\TweetClassification\dev\TextModels\src\ULMFiT\sentiment.jl:75
[4] top-level scope
@ REPL[5]:1
[5] top-level scope
@ C:\Users\Admin\.julia\packages\CUDA\DfvRa\src\initialization.jl:52
```

Running the following below line 49 of `ULMFiT/sentiment.jl`:

```
i = 0
for (p, x) in zip(Flux.params(sc), weights)
println("Iteration ", i)
println("size(p): ", size(p))
println("size(x): ", size(x))
size(p) == size(x) ||
error("Expected param size (size(p)), got (size(x))")
i += 1
println()
end
```
I get

![image](https://user-images.githubusercontent.com/52829385/181585035-baea72ff-3bf0-4a22-9979-754eea94bf5e.png)

Any workaround/solution?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.