資源簡介
MATLAB中GAN網絡實現,包含minist測試數據
代碼片段和文件信息
clc
clear
%%?構造真實訓練樣本?60000個樣本?1*784維(28*28展開)
load?mnist_uint8;
train_x?=?double(train_x(1:60000:))?/?255;
%?真實樣本認為為標簽?[1?0];?生成樣本為[0?1];
train_y?=?double(ones(size(train_x1)1));
%?normalize
train_x?=?mapminmax(train_x?0?1);
rand(‘state‘0)
%%?構造模擬訓練樣本?60000個樣本?1*100維
test_x?=?normrnd(01[60000100]);?%?0-255的整數
test_x?=?mapminmax(test_x?0?1);
test_y?=?double(zeros(size(test_x1)1));
test_y_rel?=?double(ones(size(test_x1)1));
%%
nn_G_t?=?nnsetup([100?784]);
nn_G_t.activation_function?=?‘sigm‘;
nn_G_t.output?=?‘sigm‘;
nn_D?=?nnsetup([784?100?1]);
nn_D.weightPenaltyL2?=?1e-4;??%??L2?weight?decay
nn.dropoutFraction?=?0.5;???%??Dropout?fraction?
nn.learningRate?=?0.01;????????????????%??Sigm?require?a?lower?learning?rate
nn_D.activation_function?=?‘
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2506??2018-04-17?15:38??GANtest.m
?????文件???14735220??2015-12-01?02:29??mnist_uint8.mat
-----------?---------??----------?-----??----
?????????????14737726????????????????????2
評論
共有 條評論