We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flatten
When using Metalhead models, layers using flatten appear as closures, e.g. Metalhead.var"#44#45"() in the following example.
Metalhead.var"#44#45"()
This makes it impossible to dispatch on these layers or infer what they are without looking into the Metalhead source.
julia> model = VGG19(); julia> model.layers Chain( Conv((3, 3), 3 => 64, relu, pad=1), # 1_792 parameters Conv((3, 3), 64 => 64, relu, pad=1), # 36_928 parameters MaxPool((2, 2)), Conv((3, 3), 64 => 128, relu, pad=1), # 73_856 parameters Conv((3, 3), 128 => 128, relu, pad=1), # 147_584 parameters MaxPool((2, 2)), Conv((3, 3), 128 => 256, relu, pad=1), # 295_168 parameters Conv((3, 3), 256 => 256, relu, pad=1), # 590_080 parameters Conv((3, 3), 256 => 256, relu, pad=1), # 590_080 parameters Conv((3, 3), 256 => 256, relu, pad=1), # 590_080 parameters MaxPool((2, 2)), Conv((3, 3), 256 => 512, relu, pad=1), # 1_180_160 parameters Conv((3, 3), 512 => 512, relu, pad=1), # 2_359_808 parameters Conv((3, 3), 512 => 512, relu, pad=1), # 2_359_808 parameters Conv((3, 3), 512 => 512, relu, pad=1), # 2_359_808 parameters MaxPool((2, 2)), Conv((3, 3), 512 => 512, relu, pad=1), # 2_359_808 parameters Conv((3, 3), 512 => 512, relu, pad=1), # 2_359_808 parameters Conv((3, 3), 512 => 512, relu, pad=1), # 2_359_808 parameters Conv((3, 3), 512 => 512, relu, pad=1), # 2_359_808 parameters MaxPool((2, 2)), Metalhead.var"#44#45"(), Dense(25088, 4096, relu), # 102_764_544 parameters Dropout(0.5), Dense(4096, 4096, relu), # 16_781_312 parameters Dropout(0.5), Dense(4096, 1000), # 4_097_000 parameters NNlib.softmax, ) # Total: 38 arrays, 143_667_240 parameters, 548.053 MiB. (jl_qLymP0) pkg> status Metalhead Status `/private/var/folders/74/wcz8c9qs5dzc8wgkk7839k5c0000gn/T/jl_qLymP0/Project.toml` [dbeba491] Metalhead v0.5.3
The text was updated successfully, but these errors were encountered:
I'm not sure whether this is just a missing reexport by Metalheads or whether I should make a PR to Flux.
I guess the introduction of a struct would be most useful for my personal use-case of dispatching on individual layer types:
struct Flatten end (::Flatten)(x) = flatten(x)
Sorry, something went wrong.
This should be fixed on master as of #70. You should see then flatten instead of an anonymous function.
No branches or pull requests
When using Metalhead models, layers using
flatten
appear as closures, e.g.Metalhead.var"#44#45"()
in the following example.This makes it impossible to dispatch on these layers or infer what they are without looking into the Metalhead source.
Example
The text was updated successfully, but these errors were encountered: