Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SCL-my
Overview
Overview
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
YuxuanGuo
SCL-my
Commits
c5ff8825
Commit
c5ff8825
authored
Mar 14, 2022
by
yuxguo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5f1dd634
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
main.py
+3
-2
No files found.
main.py
View file @
c5ff8825
...
...
@@ -421,7 +421,7 @@ def validate(validloader, model, epoch):
accuracy
=
correct
*
100.
/
label
.
size
()[
0
]
acc_all
+=
accuracy
if
counter
>
0
:
logging
.
info
(
"Total Validation Acc
: {:.4f}"
.
format
(
acc_all
/
float
(
counter
)))
logging
.
info
(
"Total Validation Acc
at epoch {}: {:.4f}"
.
format
(
epoch
,
acc_all
/
float
(
counter
)))
return
acc_all
/
float
(
counter
)
def
test
(
testloader
,
model
,
epoch
):
...
...
@@ -447,7 +447,7 @@ def test(testloader, model, epoch):
accuracy
=
correct
*
100.
/
label
.
size
()[
0
]
acc_all
+=
accuracy
if
counter
>
0
:
logging
.
info
(
"Total Testing Acc
: {:.4f}"
.
format
(
acc_all
/
float
(
counter
)))
logging
.
info
(
"Total Testing Acc
at epoch {}: {:.4f}"
.
format
(
epoch
,
acc_all
/
float
(
counter
)))
return
acc_all
/
float
(
counter
)
def
main
():
...
...
@@ -466,6 +466,7 @@ def main():
for
epoch
in
range
(
args
.
epochs
):
train
(
trainloader
,
optimizer
,
model
,
epoch
)
if
epoch
%
5
==
0
:
validate
(
validloader
,
model
,
epoch
)
test
(
testloader
,
model
,
epoch
)
...
...
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