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
# define custom block
num_hidden = 256 num_outputs = 1 net = gluon.nn.Sequential() with net.name_scope(): net.add(gluon.nn.Dense(num_hidden, activation="relu")) net.add(gluon.nn.Dense(num_hidden, activation="relu")) net.add(gluon.nn.Dense(num_outputs))
# collect params defined in the blocks
net.collect_params().initialize(mx.init.Normal(sigma=1.), ctx=ctx) net(nd.ones((1, 100), ctx=ctx))
#save and load params
filename = "checkpoints/testnet.params" net.save_params(filename) net2 = gluon.nn.Sequential() with net2.name_scope(): net2.add(gluon.nn.Dense(num_hidden, activation="relu")) net2.add(gluon.nn.Dense(num_hidden, activation="relu")) net2.add(gluon.nn.Dense(num_outputs)) net2.load_params(filename, ctx=ctx) net2(nd.ones((1, 100), ctx=ctx))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
# define custom block
# collect params defined in the blocks
#save and load params
The text was updated successfully, but these errors were encountered: