Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DeepInverse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hailu, Dawit
DeepInverse
Commits
b80536f4
Unverified
Commit
b80536f4
authored
5 years ago
by
William Falcon
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
update with new syntax
parent
77c1232d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
research_seed/mnist/mnist.py
+3
-3
3 additions, 3 deletions
research_seed/mnist/mnist.py
with
3 additions
and
3 deletions
research_seed/mnist/mnist.py
+
3
−
3
View file @
b80536f4
...
@@ -23,13 +23,13 @@ class CoolSystem(pl.LightningModule):
...
@@ -23,13 +23,13 @@ class CoolSystem(pl.LightningModule):
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
return
torch
.
relu
(
self
.
l1
(
x
.
view
(
x
.
size
(
0
),
-
1
)))
return
torch
.
relu
(
self
.
l1
(
x
.
view
(
x
.
size
(
0
),
-
1
)))
def
training_step
(
self
,
batch
,
batch_
nb
):
def
training_step
(
self
,
batch
,
batch_
idx
):
# REQUIRED
# REQUIRED
x
,
y
=
batch
x
,
y
=
batch
y_hat
=
self
.
forward
(
x
)
y_hat
=
self
.
forward
(
x
)
return
{
'
loss
'
:
F
.
cross_entropy
(
y_hat
,
y
)}
return
{
'
loss
'
:
F
.
cross_entropy
(
y_hat
,
y
)}
def
validation_step
(
self
,
batch
,
batch_
nb
):
def
validation_step
(
self
,
batch
,
batch_
idx
):
# OPTIONAL
# OPTIONAL
x
,
y
=
batch
x
,
y
=
batch
y_hat
=
self
.
forward
(
x
)
y_hat
=
self
.
forward
(
x
)
...
@@ -46,7 +46,7 @@ class CoolSystem(pl.LightningModule):
...
@@ -46,7 +46,7 @@ class CoolSystem(pl.LightningModule):
return
torch
.
optim
.
Adam
(
self
.
parameters
(),
lr
=
self
.
hparams
.
learning_rate
)
return
torch
.
optim
.
Adam
(
self
.
parameters
(),
lr
=
self
.
hparams
.
learning_rate
)
@pl.data_loader
@pl.data_loader
def
tn
g
_dataloader
(
self
):
def
t
rai
n_dataloader
(
self
):
# REQUIRED
# REQUIRED
return
DataLoader
(
MNIST
(
os
.
getcwd
(),
train
=
True
,
download
=
True
,
transform
=
transforms
.
ToTensor
()),
batch_size
=
self
.
hparams
.
batch_size
)
return
DataLoader
(
MNIST
(
os
.
getcwd
(),
train
=
True
,
download
=
True
,
transform
=
transforms
.
ToTensor
()),
batch_size
=
self
.
hparams
.
batch_size
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment