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
1de0f23d
Commit
1de0f23d
authored
2 years ago
by
Max Ramsay King
Browse files
Options
Downloads
Patches
Plain Diff
corrected megapolicy
parent
926ee191
No related branches found
No related tags found
No related merge requests found
Pipeline
#272320
canceled
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MetaAugment/autoaugment_learners/aa_learner.py
+18
-33
18 additions, 33 deletions
MetaAugment/autoaugment_learners/aa_learner.py
with
18 additions
and
33 deletions
MetaAugment/autoaugment_learners/aa_learner.py
+
18
−
33
View file @
1de0f23d
...
...
@@ -407,38 +407,23 @@ class aa_learner:
return
accuracy
#
def
demo_plot(self, train_dataset, test_dataset, child_network_architecture, n=5
):
#
"""
#
I made this to plot a couple of accuracy graphs to help manually tune my gradient
#
optimizer hyperparamet
ers
.
def
get_mega_policy
(
self
,
number_policies
):
"""
Produces a mega policy, based on the n best subpolicies (evo learner)/policies
(other learn
ers
)
# Saves a plot of `n` training accuracy graphs overlapped.
# """
# acc_lists = []
# # This is dummy code
# # test out `n` random policies
# for _ in range(n):
# policy = self._generate_new_policy()
# pprint(policy)
# reward, acc_list = self._test_autoaugment_policy(policy,
# child_network_architecture,
# train_dataset,
# test_dataset,
# logging=True)
# self.history.append((policy, reward))
# acc_lists.append(acc_list)
# for acc_list in acc_lists:
# plt.plot(acc_list)
# plt.title('I ran 5 random policies to see if there is any sign of \
# catastrophic failure during training. If there are \
# any lines which reach significantly lower (>10%) \
# accuracies, you might want to tune the hyperparameters')
# plt.xlabel('epoch')
# plt.ylabel('accuracy')
# plt.show()
# plt.savefig('training_graphs_without_policies')
\ No newline at end of file
Args:
number_policies -> int: Number of (sub)policies to be included in the mega
policy
Returns:
megapolicy -> [subpolicy, subpolicy, ...]
"""
inter_pol
=
sorted
(
self
.
history
,
key
=
lambda
x
:
x
[
1
],
reverse
=
True
)[:
number_policies
]
megapol
=
[]
for
pol
in
inter_pol
:
megapol
+=
pol
[
0
]
return
megapol
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