Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKLearn Modules weird behavior with linear encoder passed in fit kwargs #237

Open
cnellington opened this issue Apr 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@cnellington
Copy link
Owner

cnellington commented Apr 9, 2024

To reproduce

import numpy as np
C = np.random.normal(0, 1, (100, 2))
X = np.random.normal(0, 1, (100, 2))
Y = np.random.normal(0, 1, 100)

from contextualized.easy import ContextualizedRegressor
model = ContextualizedRegressor(encoder_type='linear')
model.fit(C, X, Y)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/calebellington/Workbench/Contextualized/contextualized/easy/wrappers/SKLearnWrapper.py", line 514, in fit
    model = self.base_constructor(**organized_kwargs["model"])
  File "/Users/calebellington/Workbench/Contextualized/contextualized/regression/lightning_modules.py", line 69, in __init__
    self._build_metamodel(*args, **kwargs)
  File "/Users/calebellington/Workbench/Contextualized/contextualized/regression/lightning_modules.py", line 243, in _build_metamodel
    self.metamodel = NaiveMetamodel(*args, **kwargs)
  File "/Users/calebellington/Workbench/Contextualized/contextualized/regression/metamodels.py", line 50, in __init__
    self.context_encoder = encoder(context_dim, out_dim, **encoder_kwargs)
TypeError: Linear.__init__() got an unexpected keyword argument 'width'
@cnellington cnellington added the bug Something isn't working label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant