Skip to content

New adapter transforms: subsetting arrays #278

Open
@paul-buerkner

Description

@paul-buerkner

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)

Metadata

Metadata

Labels

featureNew feature or requestgood first issueGood for first-time contributors

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions