-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support for variably sized inputs #168
Comments
Hi @kiudee, From the docstring of cs-ranking/csrank/core/fate_network.py Lines 470 to 471 in f266087
and also the dict check in _fit() : cs-ranking/csrank/core/fate_network.py Line 313 in f266087
suggest there should already be some kind of support for instances with different amount of objects inside. But then on the first line of cs-ranking/csrank/core/fate_network.py Line 508 in f266087
Could you elaborate on the current state of things? Or more concrete:
Here, do you mean simply padding both X and Y with np.zeros? What would be the tradeoff you mentioned there? Any other alternatives? |
Hey @ddelange, Regarding {
3: np.array(...), # shape: (n_instances_with_3_objects, 3, n_features)
4: np.array(...), # shape: (n_instances_with_4_objects, 4, n_features)
...
} That way each Since the line cs-ranking/csrank/core/fate_network.py Line 508 in f266087
is only ever used for the fixed size representation, it could be as simple as inserting an if there: if not isinstance(X, dict):
_n_instances, self.n_objects_fit_, self.n_object_features_fit_ = X.shape @timokau what do you think?
Yes, basically you would determine the maximum number of objects you want to input, lets call it |
I'm not sure if it would be quite that simple. For example the |
cs-ranking is currently requiring the user to provide a fixed input size.
There exist different tricks to be able to handle variably sized inputs (e.g. padding to maximum length), but all with their own trade-offs.
Approaches like nested tensors could be useful in solving this issue more elegantly.
The text was updated successfully, but these errors were encountered: