Skip to content

Expose nclasses option for DenseNet #154

New issue

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

Merged
merged 2 commits into from
May 15, 2022
Merged
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Metalhead"
uuid = "dbeba491-748d-5e0e-a39e-b530a07fa0cc"
version = "0.7.0"
version = "0.7.1"

[deps]
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
Expand Down
4 changes: 2 additions & 2 deletions src/convnets/densenet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ Set `pretrain = true` to load the model with pre-trained weights for ImageNet.

See also [`Metalhead.densenet`](#).
"""
function DenseNet(config::Int = 121; pretrain = false)
function DenseNet(config::Int = 121; pretrain = false, nclasses = 1000)
@assert config in keys(densenet_config) "`config` must be one out of $(sort(collect(keys(densenet_config))))."
model = DenseNet(densenet_config[config])
model = DenseNet(densenet_config[config]; nclasses = nclasses)

pretrain && loadpretrain!(model, string("DenseNet", config))
return model
Expand Down