Skip to content
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

Doc: Make the vrelu example from the intro work. #1025

Open
awf opened this issue Aug 22, 2021 · 0 comments
Open

Doc: Make the vrelu example from the intro work. #1025

awf opened this issue Aug 22, 2021 · 0 comments

Comments

@awf
Copy link
Contributor

awf commented Aug 22, 2021

The doc intro describes this NN - we should make it a proper example, and unit test/benchmark it

We'll make a simple DNN with vrelu3 activations, as in link

# Initialize the model using nn.Sequential
model = nn.Sequential(OrderedDict([
                    ('fc1', nn.Linear(784, 256)),
                    ('activation1', vrelu3),
                    ('fc2', nn.Linear(256, 128)),
                    ('bn2', nn.BatchNorm1d(num_features=128)),
                    ('activation2', vrelu3),
                    ('dropout', nn.Dropout(0.3)),
                    ('fc3', nn.Linear(128, 64)),
                    ('bn3', nn.BatchNorm1d(num_features=64)),
                    ('activation3', vrelu3),
                    ('logits', nn.Linear(64, 10)),
                    ('logsoftmax', nn.LogSoftmax(dim=1))]))

# Run training
train_model(model)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant