yechengxi / LightNet

Efficient, transparent deep learning in hundreds of lines of code.
Other
270 stars 116 forks source link

zeros(4,MaxUpdateDelay,'like',state); #7

Closed aysegulucar2016 closed 7 years ago

aysegulucar2016 commented 7 years ago

Main_Cart_Pole_Q_Network Error using zeros Leading inputs must be numeric.

Error in Main_Cart_Pole_Q_Network (line 63) InputBatch=zeros(4,MaxUpdateDelay,'like',state);

what is problem?

Matlab has error zeros(4,MaxUpdateDelay,'like',state); Error using zeros Leading inputs must be numeric.

or I run runall

RunAll Testing training a multilayer perceptron.

use_gpu =

 0

opts =

use_nntoolbox: 1

Undefined variable "nnet" or class "nnet.internal.cnn.layer.Convolution2D".

Error in linear_layer (line 14) opts.layer{opts.current_layer}.fc_nntb=nnet.internal.cnn.layer.Convolution2D('conv2d_nntb', [1,1], in ,out, [1,1], [0,0]);

Error in net_ff (line 54) [res(layer+1).x,~,~,opts] = linear_layer( res(layer).x,net.layers{1,layer}.weights{1},net.layers{1,layer}.weights{2},[], opts);

Error in select_learning_rate (line 38) [ net,res,opts ] = net_ff( net,res,opts );

Error in selective_sgd (line 13) [lr_best]=select_learning_rate(net,opts);

Error in train_net (line 20) [ net,opts ] = selective_sgd( net,opts );

Error in TrainingScript (line 51) [net,opts]=train_net(net,opts);

yechengxi commented 7 years ago

You may need to use the latest matlab to run these examples. Furthermore, make sure you install the neural network toolbox in matlab if you set opts.use_nntoolbox=1; It is recommended also to set use_gpu=1; since the cpu version of nn toolbox functions is very slow.

aysegulucar2016 commented 7 years ago

Thanks for answer. I installad 2017a. There is no problem. However I would like to ask

Should I do an additional adjustment for cudnn in your toolbox or matlab neural networks toolbox?

Sincerely

yechengxi commented 7 years ago

Neural network toolbox uses CUDNN functions so you don't need to make further adjustments.