CLASS vlt.signal.timeseriesDetectorML.conv1dNet¶
CONV1DNET - A convenience class for creating a 2-tier 1D CNN for time series.
This class simplifies the creation of a common 2-tier CNN architecture
by providing named parameters for the network's structure. It inherits
the training and evaluation methods from the dlt class.
Superclasses¶
vlt.signal.timeseriesDetectorML.dlt, vlt.signal.timeseriesDetectorML.base
Properties¶
| Property | Description |
|---|---|
| Layers | |
| DLToptions | |
| Net | |
| DetectorSamples | |
| detectorSamples |
Methods¶
| Method | Description |
|---|---|
| buildTimeseriesDetectorMLFromDirectory | build a detector from a directory |
| conv1dNet | Creates a new 1D CNN detector. |
| detectEvents | Detect events in a time series |
| detectIndividualEvents | Detect discrete events from detector output likelihood |
| evaluateTimeSeries | Evaluate the network on a time series |
| negativeShoulderEvents | Generate negative observations from shoulders of positive events |
| timeStamps2NegativeObservations | Generate negative observations by random sampling |
| timeStamps2Observations | Extract observations from time series based on timestamps |
| train | Train the network using the Deep Learning Toolbox |
Methods help¶
buildTimeseriesDetectorMLFromDirectory - build a detector from a directory
DETECTOR = vlt.signal.timeseriesDetectorML.base.buildTimeseriesDetectorMLFromDirectory(DIRNAME)
Builds a new vlt.signal.timeseriesDetectorML object from a directory DIRNAME.
The directory must contain:
1) 'parameters.json' - a file that describes how to build the object.
It should have a field 'timeseriesDetectorMLClassName' that has the classname
of the object to create.
It should have a field 'creatorInputArgs' that is a structure array with fields
'name' and 'value'. These are the arguments to be passed to the creator.
Argument names 'requiredArg1', 'requiredArg2', etc, are assumed to be required
positional arguments. Other argument names are assumed to be name/value pairs.
2) '*positive*.mat' files - one or more MAT-files that contain a variable 'positiveExamples'
which is a matrix of positive examples.
3) '*negative*.mat' files - one or more MAT-files that contain a variable 'negativeExamples'
which is a matrix of negative examples.
The DETECTOR is returned with its parameters trained on the positive and negative examples.
Help for vlt.signal.timeseriesDetectorML.conv1dNet.buildTimeseriesDetectorMLFromDirectory is inherited from superclass vlt.signal.timeseriesDetectorML.base
conv1dNet - Creates a new 1D CNN detector.
OBJ = vlt.signal.timeseriesDetectorML.conv1dNet( ... )
Accepts name-value pairs to define the network architecture.
Documentation for vlt.signal.timeseriesDetectorML.conv1dNet/conv1dNet
doc vlt.signal.timeseriesDetectorML.conv1dNet
detectEvents - Detect events in a time series
[DETECTEDEVENTS, LIKELIHOOD] = DETECTEVENTS(OBJ, TIMESERIESDATA, OPTIONS)
Detects events by finding threshold crossings in the likelihood signal
and identifying the peak likelihood within each suprathreshold interval.
The peak is defined as the maximum value in the interval. If multiple
points share the maximum value, the center point (or left of center)
is selected.
Inputs:
OBJ - The detector object.
TIMESERIESDATA - The time series data vector.
OPTIONS - Name-value arguments:
'threshold' (double, default 0.5) - Detection threshold.
'timestamps' (double, default []) - Optional time vector. If provided,
returns event times instead of indices.
'refractoryPeriod' (double, default 0.002) - Minimum distance from any positive event.
If 'timestamps' is provided, units are seconds.
Otherwise, units are samples (rounded).
Outputs:
DETECTEDEVENTS - Vector of sample indices (or times) where events were detected.
LIKELIHOOD - The likelihood signal computed by the detector.
Help for vlt.signal.timeseriesDetectorML.conv1dNet/detectEvents is inherited from superclass vlt.signal.timeseriesDetectorML.base
detectIndividualEvents - Detect discrete events from detector output likelihood
[EVENTTIMES, FILTERED_SIGNAL] = DETECTINDIVIDUALEVENTS(TIMESERIESTIMESTAMPS, DETECTOROUTPUT, OPTIONS)
Smooths the detector output and finds peaks above a threshold to identify event times.
Applies a refractory period to merge close detections.
Inputs:
TIMESERIESTIMESTAMPS - Time vector corresponding to the detector output.
DETECTOROUTPUT - Likelihood signal from the detector.
OPTIONS - Name-value arguments:
'useGaussianBlur' (logical, default true) - Whether to smooth the output.
'gaussianSigmaTime' (double, default 0.010) - Sigma for Gaussian smoothing (in time units).
'refractoryPeriod' (double, default 0.010) - Minimum time between events.
'threshold' (double, default 0.9) - Detection threshold.
Outputs:
EVENTTIMES - Vector of detected event timestamps.
FILTERED_SIGNAL - The smoothed detector output signal.
Help for vlt.signal.timeseriesDetectorML.conv1dNet.detectIndividualEvents is inherited from superclass vlt.signal.timeseriesDetectorML.base
evaluateTimeSeries - Evaluate the network on a time series
Uses a batched approach for efficient prediction.
Help for vlt.signal.timeseriesDetectorML.conv1dNet/evaluateTimeSeries is inherited from superclass vlt.signal.timeseriesDetectorML.dlt
negativeShoulderEvents - Generate negative observations from shoulders of positive events
[OBSERVATIONS, TFVALUES, NEWTIMESTAMPS] = NEGATIVESHOULDEREVENTS(TIMESERIESTIMESTAMPS, TIMESERIESDATA, POSITIVEEVENTTIMESTAMPS, DETECTORSAMPLES, OPTIONS)
Generates negative examples by sampling the "shoulders" (near misses) of known positive events.
It samples every time point within the specified shoulder windows.
Inputs:
TIMESERIESTIMESTAMPS - Time vector of the time series.
TIMESERIESDATA - Data vector of the time series.
POSITIVEEVENTTIMESTAMPS - Vector of known positive event timestamps.
DETECTORSAMPLES - Size of the window to extract (in samples).
OPTIONS - Name-value arguments:
'leftShoulderOnset' (double, default -0.010) - Start time of left shoulder relative to event.
'leftShoulderOffset' (double, default -0.005) - End time of left shoulder relative to event.
'rightShoulderOnset' (double, default 0.005) - Start time of right shoulder relative to event.
'rightShoulderOffset' (double, default 0.010) - End time of right shoulder relative to event.
'refractoryPeriod' (double, default 0.002) - Minimum distance from any positive event.
Outputs:
OBSERVATIONS - Extracted data matrix.
TFVALUES - Boolean vector (all false).
NEWTIMESTAMPS - The timestamps selected.
Help for vlt.signal.timeseriesDetectorML.conv1dNet.negativeShoulderEvents is inherited from superclass vlt.signal.timeseriesDetectorML.base
timeStamps2NegativeObservations - Generate negative observations by random sampling
[OBSERVATIONS, TFVALUES, NEWTIMESTAMPS] = TIMESTAMPS2NEGATIVEOBSERVATIONS(TIMESERIESTIMESTAMPS, TIMESERIESDATA, DETECTEDTIMESTAMPS, DETECTORSAMPLES, OPTIONS)
Generates negative examples by randomly sampling the time series at locations
that are sufficiently far from known positive events (DETECTEDTIMESTAMPS).
Inputs:
TIMESERIESTIMESTAMPS - Time vector of the time series.
TIMESERIESDATA - Data vector of the time series.
DETECTEDTIMESTAMPS - Vector of known positive event timestamps.
DETECTORSAMPLES - Size of the window to extract (in samples).
OPTIONS - Name-value arguments:
'minimumSpacingFromPositive' (double, default 0.050) - Minimum time distance from any positive event.
'negativeDataSetSize' (double, default 2 * numel(detectedTimeStamps)) - Number of negative examples to generate.
Also accepts options for timeStamps2Observations (though optimizeForPeak is usually false for random noise).
Outputs:
OBSERVATIONS - Extracted data matrix (detectorSamples x numExamples).
TFVALUES - Boolean vector (all false).
NEWTIMESTAMPS - The random timestamps selected.
Help for vlt.signal.timeseriesDetectorML.conv1dNet.timeStamps2NegativeObservations is inherited from superclass vlt.signal.timeseriesDetectorML.base
timeStamps2Observations - Extract observations from time series based on timestamps
[OBSERVATIONS, TFVALUES, NEWTIMESTAMPS] = TIMESTAMPS2OBSERVATIONS(TIMESERIESTIMESTAMPS, TIMESERIESDATA, DETECTEDTIMESTAMPS, DETECTORSAMPLES, EXAMPLESAREPOSITIVES, OPTIONS)
Extracts windows of data centered around specific timestamps. Can optionally optimize the
timestamps to align with local peaks in the data.
Inputs:
TIMESERIESTIMESTAMPS - Time vector of the time series.
TIMESERIESDATA - Data vector of the time series.
DETECTEDTIMESTAMPS - Vector of timestamps around which to extract data.
DETECTORSAMPLES - Size of the window to extract (in samples).
EXAMPLESAREPOSITIVES - Boolean, true if these are positive examples (sets TFvalues).
OPTIONS - Name-value arguments:
'optimizeForPeak' (logical, default false) - Whether to align to local peaks.
'peakFindingSamples' (double, default 10) - Window size for peak search (+/- samples).
'useNegativeForPeak' (logical, default false) - If true, searches for local minimum instead of maximum.
Outputs:
OBSERVATIONS - Extracted data matrix (detectorSamples x numExamples).
TFVALUES - Boolean vector indicating class (all true or all false).
NEWTIMESTAMPS - The actual timestamps used for extraction (refined if optimized).
Help for vlt.signal.timeseriesDetectorML.conv1dNet.timeStamps2Observations is inherited from superclass vlt.signal.timeseriesDetectorML.base
train - Train the network using the Deep Learning Toolbox
Reshapes the data and trains the network using trainNetwork.
Help for vlt.signal.timeseriesDetectorML.conv1dNet/train is inherited from superclass vlt.signal.timeseriesDetectorML.dlt