"--task",
type=str,
default="twotargets",
- help="byheart, learnop, guessop, mixing, memory, twotargets, addition, picoclvr, mnist, maze, snake, stack, expr, rpl, grid, qmlp",
+ help="file, byheart, learnop, guessop, mixing, memory, 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("--checkpoint_name", type=str, default="checkpoint.pth")
+##############################
+# filetask
+
+parser.add_argument("--filetask_train_file", type=str, default=None)
+
+parser.add_argument("--filetask_test_file", type=str, default=None)
+
##############################
# rpl options
######################################################################
default_task_args = {
+ "file": {
+ "model": "37M",
+ "batch_size": 25,
+ "nb_train_samples": 250000,
+ "nb_test_samples": 10000,
+ },
"addition": {
"model": "352M",
"batch_size": 25,
######################################################################
-if args.task == "byheart":
+if args.task == "file":
+ assert (
+ args.filetask_train_file is not None and args.filetask_test_file is not None
+ ), "You have to specify the task train and test files"
+ task = tasks.TaskFromFile(
+ args.filetask_train_file,
+ args.filetask_test_file,
+ nb_train_samples=args.nb_train_samples,
+ nb_test_samples=args.nb_test_samples,
+ batch_size=args.batch_size,
+ device=device,
+ )
+ args.max_percents_of_test_in_train = 0
+
+elif args.task == "byheart":
task = tasks.SandBox(
problem=problems.ProblemByHeart(),
nb_train_samples=args.nb_train_samples,