Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pseudo_image
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Léo Calmettes
pseudo_image
Commits
e50d93d4
Commit
e50d93d4
authored
1 month ago
by
Schneider Leo
Browse files
Options
Downloads
Patches
Plain Diff
config solo or duo
parent
ba532fb4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/config.py
+1
-0
1 addition, 0 deletions
config/config.py
main.py
+6
-3
6 additions, 3 deletions
main.py
with
7 additions
and
3 deletions
config/config.py
+
1
−
0
View file @
e50d93d4
...
...
@@ -11,6 +11,7 @@ def load_args():
parser
.
add_argument
(
'
--lr
'
,
type
=
float
,
default
=
0.001
)
parser
.
add_argument
(
'
--batch_size
'
,
type
=
int
,
default
=
64
)
parser
.
add_argument
(
'
--model
'
,
type
=
str
,
default
=
'
ResNet18
'
)
parser
.
add_argument
(
'
--model_type
'
,
type
=
str
,
default
=
'
solo
'
)
parser
.
add_argument
(
'
--dataset_dir
'
,
type
=
str
,
default
=
'
data/processed_data/png_image/data_training
'
)
parser
.
add_argument
(
'
--output
'
,
type
=
str
,
default
=
'
output/out.csv
'
)
parser
.
add_argument
(
'
--save_path
'
,
type
=
str
,
default
=
'
output/best_model.pt
'
)
...
...
This diff is collapsed.
Click to expand it.
main.py
+
6
−
3
View file @
e50d93d4
...
...
@@ -206,10 +206,10 @@ def run_duo(args):
plt
.
plot
(
train_acc
)
plt
.
ylim
(
0
,
1.05
)
plt
.
show
()
plt
.
savefig
(
'
output/training_plot_noise_{}_lr_{}_model_{}.png
'
.
format
(
args
.
noise_threshold
,
args
.
lr
,
args
.
model
))
plt
.
savefig
(
'
output/training_plot_noise_{}_lr_{}_model_{}
_{}
.png
'
.
format
(
args
.
noise_threshold
,
args
.
lr
,
args
.
model
,
args
.
model_type
))
load_model
(
model
,
args
.
save_path
)
make_prediction_duo
(
model
,
data_test
,
'
output/confusion_matrix_noise_{}_lr_{}_model_{}.png
'
.
format
(
args
.
noise_threshold
,
args
.
lr
,
args
.
model
))
make_prediction_duo
(
model
,
data_test
,
'
output/confusion_matrix_noise_{}_lr_{}_model_{}
_{}
.png
'
.
format
(
args
.
noise_threshold
,
args
.
lr
,
args
.
model
,
args
.
model_type
))
def
make_prediction_duo
(
model
,
data
,
f_name
):
...
...
@@ -254,4 +254,7 @@ def load_model(model, path):
if
__name__
==
'
__main__
'
:
args
=
load_args
()
run
(
args
)
\ No newline at end of file
if
args
.
model_type
==
'
duo
'
:
run_duo
(
args
)
else
:
run
(
args
)
\ No newline at end of file
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