csinva / imodelsX

Scikit-learn friendly library to interpret, and prompt-engineer text datasets using large language models.
https://csinva.io/imodelsX/
MIT License
156 stars 25 forks source link

hidden_layer_sizes vs hidden_layer_size? #11

Open PapadopoulosDimitrios opened 4 months ago

PapadopoulosDimitrios commented 4 months ago

print(imodelsx.KANRegressor( hidden_layer_sizes=[32,64], hidden_layer_size=36, regularize_activation=1.0, regularize_entropy=1.0 ))

trying out this code in a Jupyter notebook I get the following error: AttributeError: 'KANRegressor' object has no attribute 'hidden_layer_size'

Same thing happens if I use hidden_layer_size=32. Any insights?

csinva commented 4 months ago

Hm what is your imodelsx version? Can you maybe try pip install --upgrade imodelsx and then rerunning?

PapadopoulosDimitrios commented 4 months ago

The version is 1.0.7 . I am using google colab so every time I start the environment anew.

The code is basically from the posted example:

X, y = make_regression(n_samples=5000, n_features=5, n_informative=3)

model_KAN = imodelsx.KANRegressor( hidden_layer_sizes=[32,64], regularize_activation=1.0, regularize_entropy=1.0 )

print(model_KAN)

model_KAN.fit(X, y) y_pred = model_KAN.predict(X)

test_correlation = np.corrcoef(y, y_pred.flatten())[0, 1] print('Test correlation:', test_correlation)

Syed-Tangim-Pasha commented 4 months ago

I faced the same problem with this library.