MCPcopy Index your code
hub / github.com/apple/ml-pointersect / __init__

Method __init__

cdslib/core/script/base_train.py:61–251  ·  view source on GitHub ↗

Args: exp_tag (str): name of the experiment config_filename (str): the yaml or json filename of the model and dataloader, etc. trainer_filename (str): the previous trainer file to resume from. None: no resum

(
            self,
            exp_tag: str = "exp",
            config_filename: str = None,
            trainer_filename: str = None,
            work_dir: str = ".",
            output_dir: str = None,
            rank: int = 0,
            n_gpus: int = 1,
            random_seed: int = 0,
            save_code: bool = True,
            exclude_dirs: T.List[str] = None,
            exp_tag_first: bool = False,
            open_tensorboard: bool = True,
            ddp_type: str = "ddp",
            start_epoch: int = 0,
            end_epoch: int = 1000000,
            max_train_epoch_batches: int = -1,
            max_valid_epoch_batches: int = -1,
            max_test_epoch_batches: int = -1,
            save_every_num_epoch: int = 1,
            validate_every_num_epoch: int = 1,
            test_every_num_epoch: int = 1,
            log_every_num_train_batch: int = 1,
            log_every_num_valid_batch: int = 1,
            log_every_num_test_batch: int = 1,
            visualize_every_num_train_batch: int = 1,
            visualize_every_num_valid_batch: int = 1,
            visualize_every_num_test_batch: int = 1,
            tensorboard_exe_path: str = "tensorboard",
            # overwrite_pretrained_names: T.List[str] = None,
            use_torchrun: bool = True,
            find_unused_parameters: bool = False,  # used for DDP, see _setup_for_distributed_learning
            *args,
            **kwargs,
    )

Source from the content-addressed store, hash-verified

59 """
60
61 def __init__(
62 self,
63 exp_tag: str = "exp",
64 config_filename: str = None,
65 trainer_filename: str = None,
66 work_dir: str = ".",
67 output_dir: str = None,
68 rank: int = 0,
69 n_gpus: int = 1,
70 random_seed: int = 0,
71 save_code: bool = True,
72 exclude_dirs: T.List[str] = None,
73 exp_tag_first: bool = False,
74 open_tensorboard: bool = True,
75 ddp_type: str = "ddp",
76 start_epoch: int = 0,
77 end_epoch: int = 1000000,
78 max_train_epoch_batches: int = -1,
79 max_valid_epoch_batches: int = -1,
80 max_test_epoch_batches: int = -1,
81 save_every_num_epoch: int = 1,
82 validate_every_num_epoch: int = 1,
83 test_every_num_epoch: int = 1,
84 log_every_num_train_batch: int = 1,
85 log_every_num_valid_batch: int = 1,
86 log_every_num_test_batch: int = 1,
87 visualize_every_num_train_batch: int = 1,
88 visualize_every_num_valid_batch: int = 1,
89 visualize_every_num_test_batch: int = 1,
90 tensorboard_exe_path: str = "tensorboard",
91 # overwrite_pretrained_names: T.List[str] = None,
92 use_torchrun: bool = True,
93 find_unused_parameters: bool = False, # used for DDP, see _setup_for_distributed_learning
94 *args,
95 **kwargs,
96 ):
97 """
98 Args:
99 exp_tag (str):
100 name of the experiment
101 config_filename (str):
102 the yaml or json filename of the model and dataloader, etc.
103 trainer_filename (str):
104 the previous trainer file to resume from. None: no resume.
105 output_dir (str):
106 the root dir of the outputs
107 rank (int):
108 the rank of the process. Optional if use torchrun to launch.
109 n_gpus (int):
110 number of gpus (world size). Optional if use torchrun to launch.
111 random_seed (int):
112 random seed
113 save_code (bool):
114 whether to save the code in output_dir for future reference.
115 exclude_dirs (list of str):
116 dirs to exclude from saving code
117 exp_tag_first (bool):
118 whether the output_dir struture is:

Callers

nothing calls this directly

Calls 4

load_optionsMethod · 0.95
_register_var_to_saveMethod · 0.95
_register_var_to_loadMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected