WLJS LogoWLJS Notebook

NetPairEmbeddingOperator

NetPairEmbeddingOperator[net] represents a net that takes a pair of arrays, embeds them into a vector space using net, and outputs the distance under the embedding.

  • NetPairEmbeddingOperator[net, opts] includes options for distance function to use and other parameters.

This is used for similarity learning and metric learning tasks.

Examples

NetPairEmbeddingOperator[LinearLayer[10]]
NetPairEmbeddingOperator[NetChain[{LinearLayer[20], Ramp, LinearLayer[10]}], 
  DistanceFunction -> CosineDistance]
NetPairEmbeddingOperator[encoder, "DistanceFunction" -> EuclideanDistance]

*See the official Wolfram Language Reference for more details.

On this page