K
- Type of key, associated with each example. Used to keep track of which score belongs to which examplepublic abstract class BaseVaeScoreWithKeyFunctionAdapter<K>
extends java.lang.Object
implements org.datavec.spark.functions.FlatMapFunctionAdapter<java.util.Iterator<scala.Tuple2<K,org.nd4j.linalg.api.ndarray.INDArray>>,scala.Tuple2<K,java.lang.Double>>
Modifier and Type | Field and Description |
---|---|
protected org.apache.spark.broadcast.Broadcast<java.lang.String> |
jsonConfig |
protected org.apache.spark.broadcast.Broadcast<org.nd4j.linalg.api.ndarray.INDArray> |
params |
Constructor and Description |
---|
BaseVaeScoreWithKeyFunctionAdapter(org.apache.spark.broadcast.Broadcast<org.nd4j.linalg.api.ndarray.INDArray> params,
org.apache.spark.broadcast.Broadcast<java.lang.String> jsonConfig,
int batchSize) |
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<scala.Tuple2<K,java.lang.Double>> |
call(java.util.Iterator<scala.Tuple2<K,org.nd4j.linalg.api.ndarray.INDArray>> iterator) |
abstract org.nd4j.linalg.api.ndarray.INDArray |
computeScore(VariationalAutoencoder vae,
org.nd4j.linalg.api.ndarray.INDArray toScore) |
abstract VariationalAutoencoder |
getVaeLayer() |
protected final org.apache.spark.broadcast.Broadcast<org.nd4j.linalg.api.ndarray.INDArray> params
protected final org.apache.spark.broadcast.Broadcast<java.lang.String> jsonConfig
public BaseVaeScoreWithKeyFunctionAdapter(org.apache.spark.broadcast.Broadcast<org.nd4j.linalg.api.ndarray.INDArray> params, org.apache.spark.broadcast.Broadcast<java.lang.String> jsonConfig, int batchSize)
params
- MultiLayerNetwork parametersjsonConfig
- MultiLayerConfiguration, as jsonbatchSize
- Batch size to use when scoringpublic abstract VariationalAutoencoder getVaeLayer()
public abstract org.nd4j.linalg.api.ndarray.INDArray computeScore(VariationalAutoencoder vae, org.nd4j.linalg.api.ndarray.INDArray toScore)