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

New adapter transforms: subsetting arrays #278

Open
paul-buerkner opened this issue Dec 11, 2024 · 0 comments
Open

New adapter transforms: subsetting arrays #278

paul-buerkner opened this issue Dec 11, 2024 · 0 comments
Labels
feature New feature or request good first issue Good for first-time contributors

Comments

@paul-buerkner
Copy link
Contributor

Sometimes, the simulators may return larger arrays than we want to use in our networks, so it would be great to have some subsetting adapter transforms.

We need:

  • Subsetting within an axis (taking only some elements) while keeping the number of axes the same. This is essentially the np.take functionality so we might want to call this transform take. In contrast to np.take, I would make axis a mandatory arguments or default it to the last axis. Example: adapter.take("x", 1:3, axis = -1)
  • Subsetting using a random set of indices (of user-specified size) within an axis. We might call this subsample. Internally it would call take after sampling the indices. Example: adapter.subsample("x", size = 3, axis = -1)
  • Removing an axis of length one. Following numpy, I would call this transform squeeze: Example: adapter.squeeze("x", axis = 1)
@paul-buerkner paul-buerkner added feature New feature or request good first issue Good for first-time contributors labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for first-time contributors
Projects
None yet
Development

No branches or pull requests

1 participant