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
0dcb24df
Commit
0dcb24df
authored
2 years ago
by
Sun Jin Kim
Browse files
Options
Downloads
Patches
Plain Diff
add __name__ to UCB1_JC_py
parent
cda1f7fb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MetaAugment/UCB1_JC_py.py
+22
-22
22 additions, 22 deletions
MetaAugment/UCB1_JC_py.py
with
22 additions
and
22 deletions
MetaAugment/UCB1_JC_py.py
+
22
−
22
View file @
0dcb24df
...
...
@@ -215,26 +215,26 @@ def run_UCB1(policies, batch_size, learning_rate, ds, toy_size, max_epochs, earl
# # In[9]:
batch_size
=
32
# size of batch the inner NN is trained with
learning_rate
=
1e-1
# fix learning rate
ds
=
"
MNIST
"
# pick dataset (MNIST, KMNIST, FashionMNIST, CIFAR10, CIFAR100)
toy_size
=
0.02
# total propeortion of training and test set we use
max_epochs
=
100
# max number of epochs that is run if early stopping is not hit
early_stop_num
=
10
# max number of worse validation scores before early stopping is triggered
num_policies
=
5
# fix number of policies
num_sub_policies
=
5
# fix number of sub-policies in a policy
iterations
=
100
# total iterations, should be more than the number of policies
IsLeNet
=
"
SimpleNet
"
# using LeNet or EasyNet or SimpleNet
# generate random policies at start
policies
=
generate_policies
(
num_policies
,
num_sub_policies
)
q_values
,
best_q_values
=
run_UCB1
(
policies
,
batch_size
,
learning_rate
,
ds
,
toy_size
,
max_epochs
,
early_stop_num
,
iterations
,
IsLeNet
)
plt
.
plot
(
best_q_values
)
best_q_values
=
np
.
array
(
best_q_values
)
save
(
'
best_q_values_{}_{}percent_{}.npy
'
.
format
(
IsLeNet
,
int
(
toy_size
*
100
),
ds
),
best_q_values
)
#best_q_values = load('best_q_values_{}_{}percent_{}.npy'.format(IsLeNet, int(toy_size*100), ds), allow_pickle=True)
if
__name__
==
'
__main__
'
:
batch_size
=
32
# size of batch the inner NN is trained with
learning_rate
=
1e-1
# fix learning rate
ds
=
"
MNIST
"
# pick dataset (MNIST, KMNIST, FashionMNIST, CIFAR10, CIFAR100)
toy_size
=
0.02
# total propeortion of training and test set we use
max_epochs
=
100
# max number of epochs that is run if early stopping is not hit
early_stop_num
=
10
# max number of worse validation scores before early stopping is triggered
num_policies
=
5
# fix number of policies
num_sub_policies
=
5
# fix number of sub-policies in a policy
iterations
=
100
# total iterations, should be more than the number of policies
IsLeNet
=
"
SimpleNet
"
# using LeNet or EasyNet or SimpleNet
# generate random policies at start
policies
=
generate_policies
(
num_policies
,
num_sub_policies
)
q_values
,
best_q_values
=
run_UCB1
(
policies
,
batch_size
,
learning_rate
,
ds
,
toy_size
,
max_epochs
,
early_stop_num
,
iterations
,
IsLeNet
)
plt
.
plot
(
best_q_values
)
best_q_values
=
np
.
array
(
best_q_values
)
save
(
'
best_q_values_{}_{}percent_{}.npy
'
.
format
(
IsLeNet
,
int
(
toy_size
*
100
),
ds
),
best_q_values
)
#best_q_values = load('best_q_values_{}_{}percent_{}.npy'.format(IsLeNet, int(toy_size*100), ds), allow_pickle=True)
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