essentia icon indicating copy to clipboard operation
essentia copied to clipboard

Improve intermediate layer extraction explanation

Open palonso opened this issue 1 year ago • 0 comments

TensorToVectorReal converts tensors to 2D arrays by flattening all axis but the last one into the first dimension. model-specific prediction algorithms (e.g., TensorflowPredictVGGish) use this algorithm to return 2D arrays since they are primarily intended for time-wise predictions or embeddings. However, it is possible to use these algorithms to extract intermediate layers of the models that may have more than two dimensions. In this case, all dimensions but the last one will be flattened. To address this:

  • TensorToVectorReal throws a warning in case it flattens a dimension.
  • We added notes explaining this behavior to the algorithms potentially affected.

Note that it is also possible to retrieve intermediate layers with their original shape using TensorflowPredict as discussed here.

palonso avatar May 26 '23 08:05 palonso