How to get the encoded data from a retrained autoencoder? Here is my example: X = bodyfat_dataset; autoenc = trainAutoencoder(X); extract1= encode(autoenc,X)' %convert to a net work net = network(autoenc); Xpred = net(X); %how do i extract the encoded data. %tried this but it did not help extract2 = net.outputs{1}
John Williams answered .
2025-11-20
% Train a first sparse autoencoder with default settings. autoenc = trainAutoencoder(X1); % convert this autoencoder into a network: net = network(autoenc); % retrain autoencoder: net = train(net,X2,X2);
genFunction(net);
features = neural_function(X1);