do_negative_feedback(model, dataset, evaluator, save_dir, feedback_dir, train_epochs=32, build_argument=None, max_iterations=0, **train_kwargs)
Runs negative feedback for multiple iterations until convergence in the form of no updates to hyperparameters or until max_iterations is reached. Returns the final model and a list of feedback outputs.
Source code in wt_ml/negative_feedback/nf_runner.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
run_negative_feedback_iteration(model, dataset, evaluator, save_dir, feedback_dir, iter_num, train_epochs=32, build_argument=None, **train_kwargs)
Runs a single iteration of negative feedback comprising training, evaluations, and hyperparameter updates. Returns a new model with updated hyperparameters if recommended updates are different from the current hyperparameters.
Source code in wt_ml/negative_feedback/nf_runner.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
run_nf(gt_model, dataset, save_model_dir, feedback_dir=None)
Initiates the negative feedback process.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gt_model |
ModType
|
Model to be used for negative feedback |
required |
dataset |
EconomicDataset
|
Dataset to be used for negative feedback |
required |
save_model_dir |
str | Path
|
Path to save the model |
required |
feedback_dir |
str | Path | None
|
Path to save NF output. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
tuple[dict[str, Any], list[Any]]
|
tuple[dict[str, Any], list[Any]]: Final hyperparameters and nf outputs |
Source code in wt_ml/negative_feedback/nf_runner.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
setup_all_paths(save_model_dir, feedback_dir=None)
Sets model save directory and NF output directory. If feedback_dir is None, it is set to save_model_dir/nf_feedback. If save_model_dir or feedback_dir exists, they are overwritten.
Source code in wt_ml/negative_feedback/nf_runner.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|