Contents
function test_example_DBN
load mnist_uint8; %数据归一化 train_x = double(train_x) / 255; test_x = double(test_x) / 255; train_y = double(train_y); test_y = double(test_y);
ex1 train a 100 hidden unit RBM and visualize its weights
rand('state',0) dbn.sizes = [100];%隐层设置为100个节点 opts.numepochs = 1; opts.batchsize = 100; opts.momentum = 0; opts.alpha = 1; dbn = dbnsetup(dbn, train_x, opts); dbn = dbntrain(dbn, train_x, opts); figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights