projects
/
culture.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update.
[culture.git]
/
main.py
diff --git
a/main.py
b/main.py
index
8081850
..
6a1e8c1
100755
(executable)
--- a/
main.py
+++ b/
main.py
@@
-33,7
+33,7
@@
parser.add_argument(
"--task",
type=str,
default="twotargets",
"--task",
type=str,
default="twotargets",
- help="byheart, learnop, guessop,
twotargets, addition, picoclvr, mnist, maze, snake, stack, expr, rpl
",
+ help="byheart, learnop, guessop,
degradation, twotargets, addition, picoclvr, mnist, maze, snake, stack, expr, rpl, grid, qmlp
",
)
parser.add_argument("--log_filename", type=str, default="train.log", help=" ")
)
parser.add_argument("--log_filename", type=str, default="train.log", help=" ")
@@
-46,7
+46,7
@@
parser.add_argument("--max_percents_of_test_in_train", type=int, default=1)
########################################
########################################
-parser.add_argument("--nb_epochs", type=int, default=
None
)
+parser.add_argument("--nb_epochs", type=int, default=
25
)
parser.add_argument("--batch_size", type=int, default=None)
parser.add_argument("--batch_size", type=int, default=None)
@@
-89,16
+89,21
@@
parser.add_argument("--checkpoint_name", type=str, default="checkpoint.pth")
##############################
# rpl options
##############################
# rpl options
-parser.add_argument("--rpl_nb_starting_values", type=int, default=
5
)
+parser.add_argument("--rpl_nb_starting_values", type=int, default=
3
)
parser.add_argument("--rpl_max_input", type=int, default=9)
parser.add_argument("--rpl_max_input", type=int, default=9)
-parser.add_argument("--rpl_prog_len", type=int, default=
10
)
+parser.add_argument("--rpl_prog_len", type=int, default=
8
)
-parser.add_argument("--rpl_nb_runs", type=int, default=
8
)
+parser.add_argument("--rpl_nb_runs", type=int, default=
5
)
parser.add_argument("--rpl_no_prog", action="store_true", default=False)
parser.add_argument("--rpl_no_prog", action="store_true", default=False)
+##############################
+# grid options
+
+parser.add_argument("--grid_size", type=int, default=6)
+
##############################
# picoclvr options
##############################
# picoclvr options
@@
-155,9
+160,9
@@
parser.add_argument("--expr_result_max", type=int, default=99)
parser.add_argument("--expr_input_file", type=str, default=None)
##############################
parser.add_argument("--expr_input_file", type=str, default=None)
##############################
-#
World options
+#
Misc
-parser.add_argument("--
world_vqae_nb_epochs", type=int, default=25
)
+parser.add_argument("--
degradation_hard", action="store_true", default=False
)
######################################################################
######################################################################
@@
-171,96
+176,95
@@
if args.result_dir is None:
######################################################################
default_task_args = {
######################################################################
default_task_args = {
+ "addition": {
+ "model": "352M",
+ "batch_size": 25,
+ "nb_train_samples": 250000,
+ "nb_test_samples": 10000,
+ },
"byheart": {
"model": "37M",
"byheart": {
"model": "37M",
- "nb_epochs": 2,
"batch_size": 25,
"nb_train_samples": 50000,
"nb_test_samples": 10000,
},
"batch_size": 25,
"nb_train_samples": 50000,
"nb_test_samples": 10000,
},
- "learnop": {
+ "expr": {
+ "model": "352M",
+ "batch_size": 25,
+ "nb_train_samples": 2500000,
+ "nb_test_samples": 10000,
+ },
+ "grid": {
"model": "37M",
"model": "37M",
- "nb_epochs": 15,
"batch_size": 25,
"batch_size": 25,
- "nb_train_samples": 50000,
+ "nb_train_samples":
2
50000,
"nb_test_samples": 10000,
},
"nb_test_samples": 10000,
},
+ "qmlp": {
+ "model": "37M",
+ "batch_size": 10,
+ "nb_train_samples": 100000,
+ "nb_test_samples": 1000,
+ },
"guessop": {
"model": "352M",
"guessop": {
"model": "352M",
- "nb_epochs": 5,
"batch_size": 25,
"nb_train_samples": 1000000,
"nb_test_samples": 10000,
},
"batch_size": 25,
"nb_train_samples": 1000000,
"nb_test_samples": 10000,
},
- "
twotargets
": {
+ "
learnop
": {
"model": "37M",
"model": "37M",
- "nb_epochs": 10,
"batch_size": 25,
"nb_train_samples": 50000,
"nb_test_samples": 10000,
},
"batch_size": 25,
"nb_train_samples": 50000,
"nb_test_samples": 10000,
},
- "addition": {
- "model": "352M",
- "nb_epochs": 50,
- "batch_size": 25,
- "nb_train_samples": 250000,
+ "maze": {
+ "model": "37M",
+ "batch_size": 5,
+ "nb_train_samples": 100000,
"nb_test_samples": 10000,
},
"picoclvr": {
"model": "37M",
"nb_test_samples": 10000,
},
"picoclvr": {
"model": "37M",
- "nb_epochs": 25,
"batch_size": 25,
"nb_train_samples": 250000,
"nb_test_samples": 10000,
},
"batch_size": 25,
"nb_train_samples": 250000,
"nb_test_samples": 10000,
},
- "mnist": {
- "model": "37M",
- "nb_epochs": 25,
- "batch_size": 10,
- "nb_train_samples": 60000,
- "nb_test_samples": 10000,
- },
- "maze": {
- "model": "37M",
- "nb_epochs": 25,
+ "rpl": {
+ "model": "352M",
"batch_size": 5,
"batch_size": 5,
- "nb_train_samples":
1
00000,
+ "nb_train_samples":
25
00000,
"nb_test_samples": 10000,
},
"snake": {
"model": "37M",
"nb_test_samples": 10000,
},
"snake": {
"model": "37M",
- "nb_epochs": 5,
"batch_size": 25,
"nb_train_samples": 250000,
"nb_test_samples": 10000,
},
"stack": {
"model": "37M",
"batch_size": 25,
"nb_train_samples": 250000,
"nb_test_samples": 10000,
},
"stack": {
"model": "37M",
- "nb_epochs": 15,
"batch_size": 25,
"nb_train_samples": 100000,
"nb_test_samples": 1000,
},
"batch_size": 25,
"nb_train_samples": 100000,
"nb_test_samples": 1000,
},
- "expr": {
- "model": "352M",
- "nb_epochs": 25,
+ "twotargets": {
+ "model": "37M",
"batch_size": 25,
"batch_size": 25,
- "nb_train_samples":
250
0000,
+ "nb_train_samples":
5
0000,
"nb_test_samples": 10000,
},
"nb_test_samples": 10000,
},
- "rpl": {
- "model": "352M",
- "nb_epochs": 50,
- "batch_size": 10,
- "nb_train_samples": 2500000,
+ "degradation": {
+ "model": "37M",
+ "batch_size": 25,
+ "nb_train_samples": 100000,
"nb_test_samples": 10000,
},
"nb_test_samples": 10000,
},
- "
world
": {
+ "
mnist
": {
"model": "37M",
"model": "37M",
- "nb_epochs": 10,
- "batch_size": 25,
- "nb_train_samples": 25000,
- "nb_test_samples": 1000,
+ "batch_size": 10,
+ "nb_train_samples": 60000,
+ "nb_test_samples": 10000,
},
}
},
}
@@
-410,6
+414,16
@@
elif args.task == "twotargets":
device=device,
)
device=device,
)
+elif args.task == "degradation":
+ task = tasks.SandBox(
+ problem=problems.ProblemDegradation(hard=args.degradation_hard),
+ nb_train_samples=args.nb_train_samples,
+ nb_test_samples=args.nb_test_samples,
+ batch_size=args.batch_size,
+ logger=log_string,
+ device=device,
+ )
+
elif args.task == "addition":
task = tasks.SandBox(
problem=problems.ProblemAddition(),
elif args.task == "addition":
task = tasks.SandBox(
problem=problems.ProblemAddition(),
@@
-505,12
+519,22
@@
elif args.task == "rpl":
device=device,
)
device=device,
)
-elif args.task == "world":
- task = tasks.World(
+elif args.task == "grid":
+ task = tasks.Grid(
+ nb_train_samples=args.nb_train_samples,
+ nb_test_samples=args.nb_test_samples,
+ batch_size=args.batch_size,
+ size=args.grid_size,
+ logger=log_string,
+ device=device,
+ )
+
+elif args.task == "qmlp":
+ task = tasks.QMLP(
nb_train_samples=args.nb_train_samples,
nb_test_samples=args.nb_test_samples,
batch_size=args.batch_size,
nb_train_samples=args.nb_train_samples,
nb_test_samples=args.nb_test_samples,
batch_size=args.batch_size,
-
vqae_nb_epochs=args.world_vqae_nb_epochs
,
+
result_dir=args.result_dir
,
logger=log_string,
device=device,
)
logger=log_string,
device=device,
)