Compress data according to trained replicator or autoencoder.
Outputs are the activations of the nodes in the middle layer for each
observation in newdata
encode(object, ...)# S3 method for ANN
encode(object, newdata, compression.layer = NULL, ...)
Object of class ANN
arguments to be passed down
Data to compress
Integer specifying which hidden layer is the compression layer. If NULL this parameter is inferred from the structure of the network (hidden layer with smallest number of nodes)