sustainable-processes / summit

Optimising chemical reactions using machine learning
https://gosummit.readthedocs.io/en/latest/
MIT License
118 stars 24 forks source link

Missing "blitz" module while trying to use BNNRegressor as my regressor in Experimental Emulator #266

Closed Mishal-Benz closed 4 months ago

Mishal-Benz commented 4 months ago

Description

I am trying to use the BNNRegressor in the Experimental Emulator present in the summit/benchmarks folder. The BNNRegressor is present in the function get_bnn() in the python file experimental_emulator.py. Could you please explain to me how I should access this BNNRegressor using your:

exp = ExperimentalEmulator(model_name, domain, dataset=ds, regressor=ANNRegressor)

ANNRegressor is a class in the above mentioned python file.

However the class BNNRegressor is present in the function get_bnn() present in the above mentioned python file.

What I Did

While doing:

exp = ExperimentalEmulator(model_name, domain, dataset=ds, regressor=get_bnn())

I get the following error:


in get_bnn()
   1323 def get_bnn():
-> 1324     from blitz.modules import BayesianLinear
   1325     from blitz.utils import variational_estimator
   1327     @variational_estimator
   1328     class BNNRegressor(torch.nn.Module):

ModuleNotFoundError: No module named ‘blitz'

I was unable to find this blitz folder and wanted to ask you if it is missing in the repo or if there is an alternate way that I can use the BNNRegressor in summit.

marcosfelt commented 4 months ago

Hi! Sorry I misread your question over email. Here, you just need to installed this package:

pip install blitz-bayesian-pytorch

However, I'd personally recommend using the ANNRegressor.