Skip to content
David Wood edited this page Apr 7, 2022 · 1 revision

train

Trains a model locally or in the server with set of labeled sounds. Sounds may be referenced locally or in a server and the model may be trained locally or in a server. The trained classifier may be stored in a local file or in a server running the AISP REST Server. Default is to train locally on local sounds and not store the classifier. See the Java Quickstart for details of the metadata.csv file used to label local sounds.

Sounds may be referenced locally or in a server and the model may be trained
locally or in a server. The trained classifier can be stored in a local file.
Default is to train locally on local sounds and not store the classifier.
Required options:
  -label, -sounds: see below
Model specification options:
  -model spec : specifies the type of model to use. Currently supported values
      include 'gmm', 'lpnn', 'cnn' 'dcase' and others. Use the
      ls-models tool to see all supported model names. You may define a model
      in a local JavaScript file with the .js extension, as in yourmodel.js.
      Default is ensemble.
Sound specification options:
  [list of wav files] : specifies 1 or more .wav files without labeling.
     File names are space-separated.  The can not be used with the
     -sounds option.
  -sounds csv list of (dir|metadata.csv) : specifies 1 or more metadata.csv
     files referencing sounds or directories containing a metadata.csv.
     This is an alternative to a list of wav files, but adds labels from
     metadata files.
  -metadata (all|some) : require that all files listed in the metadata file
      to be present. Only used with -sounds option.
      Default does not require all files.
  -clipLen double : splits sound recordings up into clips of the given
      number of milliseconds. Set to 0 to turn off.
      Defaults to 0
  -pad (no|zero|duplicate): when clips are shorter than the requests clip
      padding can be added to make all clips the same length. Some models may
      require this.  Zero padding sets the added samples to zero.  Duplicate
      reuses the sound as many times a necessary to set the added samples.
      No padding removes clips shorter than the requested clip length.
      Default is no padding.
  -balance: a flag that causes an equal number of sounds for each label
      value using down sampling for evaluation and training if applicable.
      Equivalent to '-balance-with down'.
  -balance-with [up|down|N]: causes the sounds to be balanced across label
      values for the named label. Samples are up/down-sampled to meet the
      maximum, minumum or given count, of samples per label value,
      respectively. Up sampling makes copies of under represented samples
      and down-sampling randomly selects from across the full set of samples.
      All balancing is applied after clipping, if requested.
  -label  : required for most operations (i.e. training, evaluation)
      Required if balancing is requested regardless of the operation performed.
  -seed  : randomly shuffle the training data using the given random
        integer seed.
Additional options:
  -noinfo : causes no information about the training data to be displayed.
      This may be useful to speed training on large training sets.
  -output  : a file into which the classifier can be written. Optional.
  -data-type (audio|xyz|mag) : specifies the type of data contained in the wav
      files and attaches an associated data type tag to the trained model.
      Default is audio.
  -fixed : flag that indicates the IFixedClassifier of the model should
      be stored instead of the trainable IClassifier version.
  -verbose : cause extra messaging to be dipslayed on the console.
Examples:
  ... -label status -sounds m1.csv,m2.csv-output classifier.cfr
  ... -label status -sounds m3.csv -output classifier.cfr -model jsfile:model.js
  ... -label status -sounds mydir -output classifier.cfr -model gmm
  ... -label status -sounds mydir -output classifier.cfr -model gmm -data-type xyz
Clone this wiki locally