Closed pfedichev closed 9 years ago
Currently run_Extract_Feats.py only supports DNN and CNN. But you can make it work with RBM/SDA simply by converting RBM/SDA models into DNN. Suppose that you are working with the MNIST example and your RBM model is "rbm.param". Then you can get the corresponding DNN model by:
python $pdnndir/cmds/run_DNN.py --train-data "train.pickle.gz" \ --valid-data "valid.pickle.gz" \ --nnet-spec "784:1024:1024:10" --lrate "C:0.0:0" --wdir ./ \ --ptr-file rbm.param --ptr-layer-number 2 \ --param-output-file dnn.param --cfg-output-file dnn.cfg
Here we set the learning rate to 0, so that NO fine-tuning will be performed. Now we can use dnn.param and dnn.cfg to do feature extraction with run_Extract_Feats.py
We just added the example examples/mnist_rbm/run.sh to demonstrate how to train a RBM model, use the RBM as the feature extractor and train the DNN model with features generated with the RBM.
run_Extract_Feats.py appears to work for DNN or CNN only. Don't ask why, but I'd need to run stacked RBMs example, trained the network but failed to extract features using run_Extract_Feats.py. Am I missing something or isn't this just not implemented?