yechengxi / lightnet Goto Github PK
View Code? Open in Web Editor NEWEfficient, transparent deep learning in hundreds of lines of code.
License: Other
Efficient, transparent deep learning in hundreds of lines of code.
License: Other
Hi,
I run into trouble of running Main_Char_LSTM.m.
I've fixed the issue with these changes:
train_lstm.m line 94-97
[ net{1},res.Gate,opts ] = opts.parameters.learning_method( net{1},res.Gate,opts); [ net{2},res.Input,opts ] = opts.parameters.learning_method (net{2},res.Input,opts ); [ net{3},res.Cell,opts ] = opts.parameters.learning_method( net{3},res.Cell,opts ); [ net{4},res.Fit,opts ] = opts.parameters.learning_method( net{4},res.Fit,opts );
changed to:
[ net{1},res.Gate,opts ] = feval(opts.parameters.learning_method,net{1},res.Gate,opts); [ net{2},res.Input,opts ] = feval(opts.parameters.learning_method,net{2},res.Input,opts ); [ net{3},res.Cell,opts ] = feval(opts.parameters.learning_method, net{3},res.Cell,opts ); [ net{4},res.Fit,opts ] = feval(opts.parameters.learning_method,net{4},res.Fit,opts );
I want to use the QRNN based on your code to solve the squence to squence problem. how can i write the code based on lightnet?
Thankyou!
Hello,
I tried running your examples (unaltered) within MATLAB R2015b x64. Unfortunately, I get errors like the following for all types of the example networks:
clear all;
cd('./RNN');
disp('Testing training an LSTM.')
Main_Char_RNN();
cd ..
Testing training an LSTM.
Error using +
Matrix dimensions must agree.
Error in linear_layer (line 56)
y=y+bias;
Error in net_ff (line 56)
[res(layer+1).x,~,~,opts] = linear_layer(
res(layer).x,net.layers{layer}.weights{1},net.layers{layer}.weights{2},[], opts );
Error in lstm_ff (line 45)
[ net{1},res.Gates{f},opts ] = net_ff( net{1},res.Gates{f},opts );
Error in train_rnn (line 29)
[ net,res,opts ] = lstm_ff( net,opts );
Error in Main_Char_RNN (line 146)
[net,opts]=train_rnn(net,opts);
I know that you specified the MATLAB-Version to be R2016b or higher. Unfortunately, I do not have that version available yet.
So I tried R2015b. As far as I was able to trace back the code, I could not see that the dimensions would be different in MATLAB R2016b. Can the newer MATLAB version simply handle the mismatching dimensions? I would have guessed no. Are the Example data maybe faulty?
Every help is appreciated!
PrepareData_MNIST_CNN and net_init_cnn_mnist are missing and there maybe more. Please check the commented parts in the Main_Template file. %% Also can you please update your comments (especially for the RL example.)
Great job tho!
When I run Main_char_RNN.m, some error happend.
错误使用 +
矩阵维度必须一致。
出错 linear_layer (line 56)
y=y+bias;
出错 net_ff (line 56)
[res(layer+1).x,,,opts] = linear_layer(
res(layer).x,net.layers{layer}.weights{1},net.layers{layer}.weights{2},[],
opts );
出错 rnn_ff (line 46)
[ net{1},res.Input{f},opts ] = net_ff( net{1},res.Input{f},opts
);
出错 train_rnn (line 36)
[ net,res,opts ] = rnn_ff( net,opts );
出错 Main_Char_RNN (line 146)
[net,opts]=train_rnn(net,opts);
the shape of y is [90,97],the bias's shape is [90,1]
Hi guys,
great work! thanks for sharing.
Just one question: what's the different of lightnet and matconvnet? better wrapper function? more convenient choices?
Thanks for your time,
peng
Hello,
I have been trying to see if I can get more use out of LightNet than I have so far gotten out of the NNToolbox. I am using MatLab R2016b, with Neural Network toolbox installed. My PC is a 16-core Xeon system, w/ GTX 1070 GPU.
One issue I have run into is that when I try to run the provided example script "Main_Char_RNN" with opts.use_nntoolbox=1
and use_gpu=0
, an error occurs. I have traced the source of the error to the function "linear_layer.m", line 26:
y=fc_nntb.forward(I);
What appears to be happening is that the 'forward' method of the 2dconvolutional layer class returns a 4-D gpuArray, and the remainder of the function is not expecting a gpuArray because use_gpu is set to 0.
I have found that changing this to y=gather(fc_nntb.forward(I));
fixes the problem, but it does not solve the problem of what to do if you don't want to use GPU at all. I have found that it is substantially faster simply to set 'use_nntoolbox' to 0.
Also, is there any more documentation available for the LSTM / GRU modules? I want to apply them to neural spike train data (as binary time series). I am having some difficulty understanding the data prep and network initialization functions.
Thanks for any help you can provide!
Hi,
I am trying use your LightNet to implement RNN/CNN in Matlab2015a, but failed. It seems that there is no successful demo.
Could you please tell me why?
The error information of performing Main_Char_RNN:
%%%%%%%%%%%%%%%%%%%%%%%%
Error using +
Matrix dimensions must agree.
Error in linear_layer (line 56)
y=y+bias;
Error in net_ff (line 40)
[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 lstm_ff (line 45)
[ net{1},res.Gates{f},opts ] = net_ff( net{1},res.Gates{f},opts );
Error in train_rnn (line 29)
[ net,res,opts ] = lstm_ff( net,opts );
Error in Main_Char_RNN (line 146)
[net,opts]=train_rnn(net,opts);
%%%%%%%%%%%%%%%%%%%%%%%
The error information of performing Main_CNN_ImageNet_minimal
Error using +
Matrix dimensions must agree.
Error in conv_layer_2d (line 103)
y=y+bias_p;
Error in net_ff (line 37)
[res(layer+1).x,,,opts] = conv_layer_2d(
res(layer).x,net.layers{1,layer}.weights{1},net.layers{1,layer}.weights{2},net.layers{1,layer}.stride,net.layers{1,layer}.pad,[],opts
);
Error in Main_CNN_ImageNet_minimal (line 33)
[ net,res,opts ] = net_ff( net,res,opts );
%%%%%%%%%%%%%%%
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);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.