Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CARIMAM_DOCC10
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maxence Ferrari
CARIMAM_DOCC10
Commits
fa104908
Commit
fa104908
authored
3 years ago
by
Maxence Ferrari
Browse files
Options
Downloads
Patches
Plain Diff
Move model class outside of main
parent
5fa2a7b0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
forward_UpDimV2_long.py
+118
-119
118 additions, 119 deletions
forward_UpDimV2_long.py
with
118 additions
and
119 deletions
forward_UpDimV2_long.py
+
118
−
119
View file @
fa104908
...
...
@@ -17,14 +17,7 @@ from tqdm import tqdm, trange
from
math
import
ceil
def
main
(
args
):
batch_size
=
64
num_feature
=
4096
num_classes
=
10
rng
=
np
.
random
.
RandomState
(
42
)
class
UpDimV2
(
torch
.
nn
.
Module
):
def
__init__
(
self
,
num_class
):
super
(
UpDimV2
,
self
).
__init__
()
self
.
activation
=
torch
.
nn
.
LeakyReLU
(
0.001
,
inplace
=
True
)
...
...
@@ -142,6 +135,12 @@ def main(args):
return
self
.
fc3
(
out
)
def
main
(
args
):
batch_size
=
64
num_feature
=
4096
num_classes
=
10
rng
=
np
.
random
.
RandomState
(
42
)
model
=
torch
.
nn
.
DataParallel
(
UpDimV2
(
num_classes
))
model
.
load_state_dict
((
torch
.
load
(
args
.
weight
)[
'
model
'
]))
model
.
to
(
'
cuda
'
)
...
...
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