![]() wd_bn_bias controls if weight decay is applied to BatchNorm layers and bias. Wd is the default weight decay used when training the model moms, the default momentums used in Learner.fit_one_cycle. Make sure you can write in path/model_dir! Often path will be inferred from dls, but you can override it or pass a Path object to model_dir. Path and model_dir are used to save and/or load models. Metrics is an optional list of metrics, that can be either functions or Metrics (see below). At creation, all the callbacks in defaults.callbacks ( TrainEvalCallback, Recorder and ProgressCallback) are associated to the Learner. Each Callback is registered as an attribute of Learner (with camel case). Callbacks are used for every tweak of the training loop. The default is trainable_params, which returns all trainable parameters of the model.Ĭbs is one or a list of Callbacks to pass to the Learner. splitter is a function that takes self.model and returns a list of parameter groups (or just one parameter group if there are no different parameter groups). Opt_func will be used to create an optimizer when Learner.fit is called, with lr as a default learning rate. Group together a model, some dls and a loss_func to handle training ![]() Source SkipToEpoch SkipToEpoch (epoch:int) You can pass in other kwargs to torch.load through torch_load_kwargs. If strict is True, the file must exactly contain weights for every parameter key in model, if strict is False, only the keys that are in the saved model are loaded in model. If a device is passed, the model is loaded on it, otherwise it’s loaded on the CPU. Load model from file along with opt (if available, and if with_opt)įile can be a Path object, a string or an opened file object. Source load_model load_model (file, model, opt, with_opt=True, device=None, strict=True, pickle_protocol and torch_save_kwargs is passed along to torch.save Save model to file along with opt (if available, and if with_opt)įile can be a Path object, a string or an opened file object. Source save_model save_model (file, model, opt, with_opt=True, pickle_protocol=2, ![]() See the class Metric below for more information. ![]() Class _A: def _init_( self, a): self.a = a def a_changed( self, v): return replacing_yield( self, 'a', v) a = _A( 42) with a.a_changed( 32): test_eq(a.a, 32) test_eq(a.a, 42)Ĭonvert m to an AvgMetric, unless it’s already a Metric ![]()
0 Comments
Leave a Reply. |