autora.theorist.bsr.prior
_get_ops_init()
Get the initialization functions for operators that require additional parameters.
Returns:
Name | Type | Description |
---|---|---|
ops_init |
Dict[str, Union[Callable, object]]
|
a dictionary that maps operator name to either a parameter
dict (in the case that the initialization is hard-coded) or an
initialization function (when it is randomized). The dictionary
value will be used in growing the |
Source code in temp_dir/bsr/src/autora/theorist/bsr/prior.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
_get_ops_with_arity()
Get the operator function and arity (number of operands) of each operator.
Returns:
Name | Type | Description |
---|---|---|
ops_fn_and_arity |
a dictionary that maps operator name to a list, where the first item is the operator function and the second is the number of operands that it takes. |
Source code in temp_dir/bsr/src/autora/theorist/bsr/prior.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
get_prior_dict(prior_name='Uniform')
Get the dictionary of prior information as well as several list of key operator properties
Argument
prior_name: the name of the prior dictionary to use
Returns:
Name | Type | Description |
---|---|---|
ops_name_lst |
the list of operator names |
|
ops_weight_lst |
the list of operator weights |
|
prior_dict |
the dictionary of operator prior information |
Source code in temp_dir/bsr/src/autora/theorist/bsr/prior.py
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 143 144 145 146 |
|
get_prior_list(prior_name='Uniform')
Get a dictionary of key prior properties
Argument
prior_name: the name of the prior dictionary to use
Returns:
Type | Description |
---|---|
a dictionary that maps a prior property (e.g. |
Source code in temp_dir/bsr/src/autora/theorist/bsr/prior.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
linear_init(**hyper_params)
Initialization function for the linear operator. Two parameters, slope (a) and intercept (b) are initialized.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hyper_params
|
the dictionary for hyperparameters. Specifically, this
function requires |
{}
|
Returns:
a dictionary with initialized a
and b
parameters.
Source code in temp_dir/bsr/src/autora/theorist/bsr/prior.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|