Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MetaRL
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Wang, Mia
MetaRL
Commits
926ee191
Commit
926ee191
authored
2 years ago
by
Max Ramsay King
Browse files
Options
Downloads
Patches
Plain Diff
full_pol to sub_pol
parent
75083fc3
No related branches found
No related tags found
No related merge requests found
Pipeline
#272318
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MetaAugment/autoaugment_learners/evo_learner.py
+6
-7
6 additions, 7 deletions
MetaAugment/autoaugment_learners/evo_learner.py
with
6 additions
and
7 deletions
MetaAugment/autoaugment_learners/evo_learner.py
+
6
−
7
View file @
926ee191
...
@@ -221,22 +221,21 @@ class evo_learner(aa_learner):
...
@@ -221,22 +221,21 @@ class evo_learner(aa_learner):
self
.
train_loader
=
torch
.
utils
.
data
.
DataLoader
(
train_dataset
,
batch_size
=
self
.
batch_size
)
self
.
train_loader
=
torch
.
utils
.
data
.
DataLoader
(
train_dataset
,
batch_size
=
self
.
batch_size
)
for
idx
,
(
test_x
,
label_x
)
in
enumerate
(
self
.
train_loader
):
for
idx
,
(
test_x
,
label_x
)
in
enumerate
(
self
.
train_loader
):
full
_pol
icy
=
self
.
_get_single_policy_cov
(
test_x
)
sub
_pol
=
self
.
_get_single_policy_cov
(
test_x
)
while
self
.
_in_pol_dict
(
full
_pol
icy
):
while
self
.
_in_pol_dict
(
sub
_pol
):
full
_pol
icy
=
self
.
_get_single_policy_cov
(
test_x
)[
0
]
sub
_pol
=
self
.
_get_single_policy_cov
(
test_x
)[
0
]
fit_val
=
self
.
_test_autoaugment_policy
(
full
_pol
icy
,
child_network_architecture
,
train_dataset
,
test_dataset
)
fit_val
=
self
.
_test_autoaugment_policy
(
sub
_pol
,
child_network_architecture
,
train_dataset
,
test_dataset
)
self
.
history
.
append
((
full
_pol
icy
,
fit_val
))
self
.
history
.
append
((
sub
_pol
,
fit_val
))
self
.
running_policy
.
append
((
full
_pol
icy
,
fit_val
))
self
.
running_policy
.
append
((
sub
_pol
,
fit_val
))
if
len
(
self
.
running_policy
)
>
self
.
sp_num
:
if
len
(
self
.
running_policy
)
>
self
.
sp_num
:
self
.
running_policy
=
sorted
(
self
.
running_policy
,
key
=
lambda
x
:
x
[
1
],
reverse
=
True
)
self
.
running_policy
=
sorted
(
self
.
running_policy
,
key
=
lambda
x
:
x
[
1
],
reverse
=
True
)
self
.
running_policy
=
self
.
running_policy
[:
self
.
sp_num
]
self
.
running_policy
=
self
.
running_policy
[:
self
.
sp_num
]
print
(
"
appended policy:
"
,
self
.
running_policy
)
if
len
(
self
.
history_best
)
==
0
:
if
len
(
self
.
history_best
)
==
0
:
...
...
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