Skip to content

← deep_learning package

RandomTimeSliceAugmentation

Extract a randomly offset time slice of the given length from the (already-segmented) input data.

The node adds a random offset drawn from the specified distribution (in the same unit as the length) to the position of the extracted segment, separately per instance, which are therefore jittered. Note that offsets that result in out-of-bounds access are clamped at the edges, i.e., if your distribution has too high variance you will get an excess number of segments that are stuck at the start or end of your original segmented time series (this can be mitigated with a truncated distribution). The slice can either be anchored at the start of the time slice (plus positive jitter offsets) or at the center of the time slice (plus or minus jitter offsets). A good starting point is a centered anchor combined with a zero-mean normal or truncated normal distribution and a standard deviation of +/- 50ms (i.e., 0.05 when using seconds as the time unit). However, the actual range should be adjusted based on the nature of the EEG phenomenon of interest (e.g., an analysis of late EEG responses may benefit from a larger jitter of as much as 100ms, while an analysis of early EEG responses should likely use jitters of no more than 10-20ms). Like most augmentation nodes, this node does not by itself amplify the amount of data, which therefore has to be done beforehand using, for example, the RepeatAlongAxis node. Also As with most augmentation nodes, you need to wire in a random seed (for example using the DrawRandomSeed node, see docs for more info) to ensure reproducibility. You also need to wire a distribution to the dist input to specify the distribution of interest (e.g., NormalDistribution). Version 0.8.2

Ports/Properties

data

Data to process.

  • verbose name: Data
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: INOUT

seed

Random seed for deterministic results.

  • verbose name: Seed
  • default value: None
  • port type: DataPort
  • value type: AnyArray (can be None)
  • data direction: IN

dist

Distribution to use.

  • verbose name: Dist
  • default value: None
  • port type: DataPort
  • value type: Distribution (can be None)
  • data direction: IN

is_training

Whether the node is used in training mode.

  • verbose name: Is Training
  • default value: None
  • port type: DataPort
  • value type: bool (can be None)
  • data direction: IN

length

Length of the time slice to take.

  • verbose name: Length
  • default value: 1.0
  • port type: FloatPort
  • value type: float (can be None)

time_unit

Unit of the jitter and length of the time slice.

  • verbose name: Time Unit
  • default value: seconds
  • port type: EnumPort
  • value type: str (can be None)

anchor

Anchor location relative to which the offset is applied. Can be the start of the time slice (for non-negative distributions) or the center of the time slice.

  • verbose name: Anchor
  • default value: center
  • port type: EnumPort
  • value type: str (can be None)

bypass

Whether to bypass the augmentation and pass the input data through unchanged.

  • verbose name: Bypass
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)