File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 6767 " GaussianProcess, \n " ,
6868 " # the custom kernel function goes here\n " ,
6969 " covar_module_fn=rbs_plus_linear_kernel,\n " ,
70+ " auto_register=True,\n " ,
71+ " overwrite=True,\n " ,
7072 " )"
7173 ]
7274 },
136138 "source" : [
137139 " from autoemulate.core.device import TorchDeviceMixin\n " ,
138140 " from autoemulate.emulators.base import PyTorchBackend\n " ,
141+ " from autoemulate.emulators import register\n " ,
139142 " import torch.nn as nn\n " ,
140143 " \n " ,
144+ " @register(overwrite=True) # decorate to register the emulator, optionally overwrite existing registration\n " ,
141145 " class SimpleFNN(PyTorchBackend):\n " ,
142146 " def __init__(\n " ,
143147 " self, \n " ,
193197 "source" : [
194198 " ae.summarise()"
195199 ]
200+ },
201+ {
202+ "cell_type" : " markdown" ,
203+ "id" : " 12" ,
204+ "metadata" : {},
205+ "source" : [
206+ " The emulator can also be reinitialized and fitted on a dataset having been registered with AutoEmulate using the `@register` decorator."
207+ ]
208+ },
209+ {
210+ "cell_type" : " code" ,
211+ "execution_count" : null ,
212+ "id" : " 13" ,
213+ "metadata" : {},
214+ "outputs" : [],
215+ "source" : [
216+ " em = ae.fit_from_reinitialized(x, y)\n " ,
217+ " print(em.model)"
218+ ]
196219 }
197220 ],
198221 "metadata" : {
211234 "name" : " python" ,
212235 "nbconvert_exporter" : " python" ,
213236 "pygments_lexer" : " ipython3" ,
214- "version" : " 3.12.11 "
237+ "version" : " 3.12.12 "
215238 }
216239 },
217240 "nbformat" : 4 ,
You can’t perform that action at this time.
0 commit comments