:py:mod:`orcanet.lib.sample_modifiers` ====================================== .. py:module:: orcanet.lib.sample_modifiers .. autoapi-nested-parse:: Some basic sample modifiers to use with orcanet. Use them by setting .cfg.sample_modifier of the orcanet.core.Organizer. .. !! processed by numpydoc !! Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: orcanet.lib.sample_modifiers.PerInputModifier orcanet.lib.sample_modifiers.JoinedModifier orcanet.lib.sample_modifiers.Permute orcanet.lib.sample_modifiers.Reshape orcanet.lib.sample_modifiers.GraphEdgeConv .. py:class:: PerInputModifier For modifiers that do the same operation on each input. Apply modify on x_value of each input, and output as dict. .. !! processed by numpydoc !! .. py:method:: modify(x_value) :abstractmethod: x_value is a batch of input data as a numpy array. .. !! processed by numpydoc !! .. py:class:: JoinedModifier(sample_modifiers) For applying multiple sample modifiers after each other. .. !! processed by numpydoc !! .. py:method:: modify(x_value) x_value is a batch of input data as a numpy array. .. !! processed by numpydoc !! .. py:class:: Permute(axes) Permute the axes of the samples to given order. Batchsize axis is excluded, i.e. start indexing with 1! .. !! processed by numpydoc !! .. py:method:: modify(x_value) x_value is a batch of input data as a numpy array. .. !! processed by numpydoc !! .. py:class:: Reshape(newshape) Reshape samples to given shape. Batchsize axis is excluded! .. !! processed by numpydoc !! .. py:method:: modify(x_value) x_value is a batch of input data as a numpy array. .. !! processed by numpydoc !! .. py:class:: GraphEdgeConv(knn=16, node_features=('pos_x', 'pos_y', 'pos_z', 'time', 'dir_x', 'dir_y', 'dir_z'), coord_features=('pos_x', 'pos_y', 'pos_z', 'time'), ragged=True, with_lightspeed=True, column_names=None, is_valid_features='is_valid', n_hits_padded=None) Read out points and coordinates, intended for the MEdgeConv layers. For DL files produced with OrcaSong in graph mode. :Parameters: **knn** : int or None Number of nearest neighbors used in the edge conv. Pad events with too few hits by duping first hit, and give a warning. **node_features** : tuple Defines the node features. **coord_features** : tuple Defines the coordinates. **ragged** : bool, optional If True, return ragged tensors (nodes, coordinates). If False, return regular tensors, padded to fixed length. n_hits_padded and is_valid_features need to be given in this case. **with_lightspeed** : bool Multiply time for coordinates input with lightspeed. Requires coord_features to have the entry 'time'. **column_names** : tuple, optional Name and order of the features in the last dimension of the array. If None is given, will attempt to auto-read the column names from the attributes of the dataset. **is_valid_features** : str Only for when ragged = False. Defines the is_valid. **n_hits_padded** : int, optional Only for when ragged = False. Pad or cut to exactly this many hits using 0s. Non-indexed datasets will automatically set this value. .. !! processed by numpydoc !! .. py:method:: reset_cache() Clear cached column names. .. !! processed by numpydoc !!