Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
tongue-diagnosis
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhiyang.zhou
tongue-diagnosis
Commits
998940bc
Commit
998940bc
authored
Jul 08, 2021
by
zhiyang.zhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor change
parent
f45e81d0
Pipeline
#196
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
train_tongue_diagnosis.py
train_tongue_diagnosis.py
+3
-2
No files found.
train_tongue_diagnosis.py
View file @
998940bc
...
...
@@ -20,7 +20,7 @@ parser.add_argument('--no_cuda', action='store_true', default=False, help='disab
parser
.
add_argument
(
'-b'
,
'--batch_size'
,
default
=
32
,
type
=
int
,
help
=
'mini-batch size (default: 32)'
)
parser
.
add_argument
(
'--lr'
,
type
=
float
,
default
=
0.05
,
metavar
=
'LR'
,
help
=
'learning rate'
)
parser
.
add_argument
(
'--momentum'
,
type
=
float
,
default
=
0.9
,
metavar
=
'M'
,
help
=
'SGD momentum'
)
parser
.
add_argument
(
'--weight_decay'
,
'--wd'
,
default
=
2e-4
,
type
=
float
,
metavar
=
'W'
)
parser
.
add_argument
(
'--weight_decay'
,
'--wd'
,
default
=
0
,
type
=
float
,
metavar
=
'W'
)
parser
.
add_argument
(
'--epochs'
,
type
=
int
,
default
=
20
,
metavar
=
'N'
,
help
=
'number of epochs to train'
)
parser
.
add_argument
(
'--schedule'
,
type
=
int
,
nargs
=
'+'
,
default
=
[
10
,
15
],
help
=
'Decrease learning rate at these epochs.'
)
...
...
@@ -154,7 +154,8 @@ def main():
print
(
args
)
# model = get_model(args.model_name, num_classes=NUM_CLASSES).to(device)
model
=
models
.
resnet50
(
pretrained
=
False
,
num_classes
=
NUM_CLASSES
)
.
to
(
device
)
optimizer
=
optim
.
SGD
(
model
.
parameters
(),
lr
=
args
.
lr
,
momentum
=
args
.
momentum
,
weight_decay
=
args
.
weight_decay
)
# optimizer = optim.SGD(model.parameters(), lr=args.lr, momentum=args.momentum, weight_decay=args.weight_decay)
optimizer
=
optim
.
Adam
(
model
.
parameters
(),
args
.
lr
,
betas
=
(
0.9
,
0.999
),
eps
=
1e-08
,
weight_decay
=
args
.
weight_decay
)
for
epoch
in
range
(
1
,
args
.
epochs
+
1
):
# adjust learning rate for SGD
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment