These are chat archives for beniz/deepdetect

18th
Sep 2016
Emmanuel Benazera
@beniz
Sep 18 2016 05:35
are you on Ubuntu? detail your OS and share the output
ehab albadawy
@ebadawy
Sep 18 2016 13:25
$ uname -a
Linux linux-ThinkPad-T520 3.19.0-65-generic #73~14.04.1-Ubuntu SMP Wed Jun 29 21:05:22 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
deeptrack
Emmanuel Benazera
@beniz
Sep 18 2016 13:41
double check your cmake and when install
Kumar Shubham
@kyrs
Sep 18 2016 18:41
@beniz check this gist I have created after reading the PR in caffe and keras based code https://gist.github.com/kyrs/e93548079ab9954915122263cf845325
I am confused on how to connect the Memory data output with Embedding layer
and also How should I add the test output layer
Emmanuel Benazera
@beniz
Sep 18 2016 18:43
@kyrs good, first make sure the top and bottom of each layer are correctly connected, at the moment I don't see they are
regarding the test layer, take a look at templates/caffe/mlp/mlp.prototxt
Kumar Shubham
@kyrs
Sep 18 2016 18:44
let me look into it
Emmanuel Benazera
@beniz
Sep 18 2016 18:48
when you are sure it's all good, merge PR #174 into your branch
then put your prototxt files into a model repository e.g. test_lstm, and setup a service with something like:
curl -X PUT "http://localhost:8080/services/n20" -d "{\"mllib\":\"caffe\",\"description\":\"newsgroup classification service\",\"type\":\"supervised\",\"parameters\":{\"input\":{\"connector\":\"txt\"},\"mllib\":{\"nclasses\":4,\"embedding\":true}},\"model\":{\"repository\":\"/path/to/test_lstm/\"}}"
don't forget to set the correct number of classes, including in your prototxt files. If that goes well, you can try training, see PR #174, it has an example for a training call with embedding.
let me know how this goes, it is unlikelty to work nicely immediately...
Also I'm not sure about the axis:2 thing in your prototxt, try it out, but it may be wrong, I don't know.
Emmanuel Benazera
@beniz
Sep 18 2016 18:53
in all cases, put the server output into a gist and I'll look at it, especially the network log, that gives each layers inputs and outputs dimensions
Kumar Shubham
@kyrs
Sep 18 2016 18:54
ok!! sure
I have modified the gist https://gist.github.com/kyrs/e93548079ab9954915122263cf845325 check this one
one more question ... what should be no of channels for memoryData
Kumar Shubham
@kyrs
Sep 18 2016 18:59
I am trying to run the code on n20 first
Emmanuel Benazera
@beniz
Sep 18 2016 19:00
n20 is difficult, from my playing with embeddings, use AGNews that has 4 classes
Kumar Shubham
@kyrs
Sep 18 2016 19:00
I guess my input to embed layer depend on no of channels in memoryData
got it
Kumar Shubham
@kyrs
Sep 18 2016 19:00
ok ...
what about the no of channels for MemoryData ??
Emmanuel Benazera
@beniz
Sep 18 2016 19:01
The channels will be the sequence, i.e. the fixed length you choose for all sentences, e.g. 100
Kumar Shubham
@kyrs
Sep 18 2016 19:03
ok I guess number of channels should be same as the input to embedding layer
Emmanuel Benazera
@beniz
Sep 18 2016 19:03
and height and width should remain 1... at least as far as I understand
Kumar Shubham
@kyrs
Sep 18 2016 19:03
got it
Emmanuel Benazera
@beniz
Sep 18 2016 19:04
the Embed layer has no channel, you set the embedding size num_output, and the total vocab size as input_dim. If you use the DD input connector, the vocabulary size is given in the server logs. You can then report it into the prototxt.
Take a look at the PR #189, the fasttext.prototxt file, it has the parameters set for AGNews. You'd need to remove some layers and put an LSTM layer after the embedding
Kumar Shubham
@kyrs
Sep 18 2016 19:06
should I keep num_output same as input_dim for testing ??
Emmanuel Benazera
@beniz
Sep 18 2016 19:07
the calls from the PR #189 should be the same with an LSTM layer I think
num_output is the dimension of the embedding, it should be much much smaller than input_dim
Kumar Shubham
@kyrs
Sep 18 2016 19:10
ok I will do the changes !!
btw no of output from LSTM in keras was 64... I guess I should keep it same ... what do you say ?
Emmanuel Benazera
@beniz
Sep 18 2016 19:12
Sure, you can experiment. When debugging, try to set values that give you results quickly. Once it works, i.e. you see the loss going down and the F1 & ACC going up, you can start tweaking more parameters.
Kumar Shubham
@kyrs
Sep 18 2016 19:14
got it .. will update you about all result
Emmanuel Benazera
@beniz
Sep 18 2016 19:15
good luck :)
Kumar Shubham
@kyrs
Sep 18 2016 19:16
:smile: