Closed paperstsoap closed 8 years ago
What NeuPy version do you use? It looks a bit old, I've already changed some part of the library. The one thing that I think can cause this problem is the file mode. Dill will write a binary string, so you need to specify it in the code. Use 'wb'
instead of 'w'
with open('network-storage.dill', 'wb') as net:
It's also important to read the network file as a binary.
with open('network-storage.dill', 'rb') as net:
cgnet = dill.load(net)
If it's not help, I will suggest upgrading the NeuPy to the version 0.2.1 and try to run this code. I've modified your code a bit to make it possible to run it on my machine.
@paperstsoap Did you solve your issue?
I upgraded to the latest version of neupy and theano, and now I am getting a error that there is no nose_parameterized module. I attempted to install that module but have not been successful at fixing that issue yet. Are you aware of any Windows bugs with respect to that?
Sent from my iPhone
On May 8, 2016, at 12:53 PM, Yurii Shevchuk notifications@github.com wrote:
@paperstsoap Did you solve your issue?
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub
That's odd. In Stackoveflow I found solution for the problem that looks similar to your, you can try to set up different protocol - http://stackoverflow.com/questions/4426981/python-pickle-dumps-assertionerror. dill works with python's pickle library, so the parameters are the same
dill.dump(obj, file_, protocol=pickle.HIGHEST_PROTOCOL)
I've been tied up this weekend with Mother's Day but I plan on putting in a solid effort for a the next few days to try to get this figured out. I will definitely keep you updated.
Sent from my iPhone
On May 8, 2016, at 3:43 PM, Yurii Shevchuk notifications@github.com wrote:
That's odd. In Stackoveflow I found solution for the problem that looks similar to your, you can try to set up different protocol - http://stackoverflow.com/questions/4426981/python-pickle-dumps-assertionerror. dill works with python's pickle library, so the parameters are the same
dill.dump(obj, file_, protocol=pickle.HIGHEST_PROTOCOL) — You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub
I have solved the problem. I updated to the latest version of neupy, which starting giving me the nose_parameterized module not found error. The issue was that the older neupy version (say 0.1.0) was still active in another location. Once I recycled that file and deleted it everything now works correctly. I guess it was pulling from the older version's path even though I installed the new one.
Thank you for all your help and quick response! I have just started messing with ANN and love your setup.
-Dave
Sent from my iPhone
On May 8, 2016, at 3:43 PM, Yurii Shevchuk notifications@github.com wrote:
That's odd. In Stackoveflow I found solution for the problem that looks similar to your, you can try to set up different protocol - http://stackoverflow.com/questions/4426981/python-pickle-dumps-assertionerror. dill works with python's pickle library, so the parameters are the same
dill.dump(obj, file_, protocol=pickle.HIGHEST_PROTOCOL) — You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub
Great!
Since the updated version uses Theano, have you ever tried using the neupy module with multiple GPUs?
-Dave
Sent from my iPhone
On May 9, 2016, at 1:43 PM, Yurii Shevchuk notifications@github.com wrote:
Great!
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub
No, just with a single one.
Do you have any sample code for doing that?
Sent from my iPhone
On May 22, 2016, at 6:02 AM, Yurii Shevchuk notifications@github.com wrote:
No, just with a single one.
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub
You can try this one https://github.com/itdxer/neupy/blob/master/examples/gd/cifar10_cnn.py But you need to set up proper configurations for Theano
Thank you for passing on the information, I really appreciate it. Would you be able to give a brief description of what it should be doing, so that I know it working properly when I try to run it?
Thank you, Dave
Sent from my iPhone
On May 22, 2016, at 11:14 AM, Yurii Shevchuk notifications@github.com wrote:
You can try this one https://github.com/itdxer/neupy/blob/master/examples/gd/cifar10_cnn.py
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub
Sorry, I didn't get it. Did you mean "What you need to do to make it possible to run NeuPy with multiple GPUs?"
Sorry if I was unclear. I asked if you had any sample code for using the neupy library with a gpu. You said that you did and sent me a link to a neupy sample code that use a gpu. I was wondering if I could get a brief description of what that sample code does so that I could understand what it does so when I try to use it, I know it is working correctly. The sample code provided looks like it does something with images, and uses the relu and softmax hidden layers, all of which I have limited knowledge on. I hope this make more sense, but if it does not I would be happy to clarify any confusion.
Thank you,
Dave
Sent from my iPhone
On May 29, 2016, at 7:42 AM, Yurii Shevchuk notifications@github.com wrote:
Sorry, I didn't get it. Do you mean "What you need to do to make it possible to run NeuPy with multiple GPUs?"
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
To make it possible to run any Theano based code on GPU you need to have preinstalled all GPU drivers and dependencies. If you have everything that you need you will be able to run code on GPU. The one important thing that you needed to add is a Theano flag that defines your GPU. It can be something like this:
$ THEANO_FLAGS=device=gpu python examples/gd/cifar10_cnn.py
The example contains convolutional neural network that trains on the CIFAR10 dataset. To test the GPU you don't need to understand network's structure inside of the script.
On GPU epoch learning time should be faster. This script works on my laptop 13 minutes per epoch, and on AWS GPU it took ~1.5 minutes per epoch or even less.
Thank you again, this is exactly the information I was unsure about. I have a GeForce GT 550M with Cuda built into my laptop that I want to get my feet wet with. I appreciate you taking the time to answer my questions.
Thank you,
Dave
Sent from my iPhone
On May 30, 2016, at 4:49 AM, Yurii Shevchuk notifications@github.com wrote:
To make it possible to run any Theano based code on GPU you need to have preinstalled all GPU drivers and dependencies. If you have everything that you need you will be able to run code on GPU. The one important thing that you needed to add is a Theano flag that defines you GPU. It can be something like this:
$ THEANO_FLAGS=device=gpu python examples/gd/cifar10_cnn.py The example contains convolutional neural network that trains on the CIFAR10 dataset. To test the GPU you don't need to understand network's structure inside of the script.
On GPU epoch learning time should be faster. This script works on my laptop 13 minutes per epoch, and on AWS GPU it took ~1.5 minutes per epoch or even less.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I have been using neupy over the past 6 months for different projects with great success. My current project requires whole integers for the application. Do you have any frameworks or recommendations for this type of problem? I have a golden search network right now that gets really close, but just not precise enough for the whole integer needed.
Thank you,
Dave
Sent from my iPhone
On May 30, 2016, at 11:34 AM, David Edelen david.edelen3@me.com wrote:
Thank you again, this is exactly the information I was unsure about. I have a GeForce GT 550M with Cuda built into my laptop that I want to get my feet wet with. I appreciate you taking the time to answer my questions.
Thank you,
Dave
Sent from my iPhone
On May 30, 2016, at 4:49 AM, Yurii Shevchuk notifications@github.com wrote:
To make it possible to run any Theano based code on GPU you need to have preinstalled all GPU drivers and dependencies. If you have everything that you need you will be able to run code on GPU. The one important thing that you needed to add is a Theano flag that defines you GPU. It can be something like this:
$ THEANO_FLAGS=device=gpu python examples/gd/cifar10_cnn.py The example contains convolutional neural network that trains on the CIFAR10 dataset. To test the GPU you don't need to understand network's structure inside of the script.
On GPU epoch learning time should be faster. This script works on my laptop 13 minutes per epoch, and on AWS GPU it took ~1.5 minutes per epoch or even less.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Hi @paperstsoap, Do you need to have an integer number as an output from your network?
Yes, that's correct.
Sent from my iPhone
On Jul 26, 2016, at 4:59 AM, Yurii Shevchuk notifications@github.com wrote:
Hi @paperstsoap, Do you need to have an integer number as an output from your network?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I think that's fine that you have float numbers as an output. Network should give you result which should be very close to integer that you expect to see. You can simply round your value to the closest integer.
In real world testing I am getting say 59 when I need 60 due to the rounding. It is training to 0.0009 RMS and is often correct, but more often it is slightly 1 higher or lower.
Sent from my iPhone
On Jul 26, 2016, at 7:56 AM, Yurii Shevchuk notifications@github.com wrote:
I think that's fine that you have float numbers as an output. Network should give you close result to to integer that you expect to see. You can just simply round your value to the closest integer.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
That's a normal case when you use regression. In addition you have very small RMS which means network has been trained successfully. You need to explore your results and understand the main source of problems from your data.
I think it also can be useful to check the residuals between raw output from the network (without rounding) and target values. Based on it you can try to figure out how to make a better way to transform raw output from the network. Of course, it's possible only in case if your residuals aren't normally distributed with mean located near the 0.
I'll explore that further. I'm currently using a sigmoid function, is there another function that might be better? I've read that the relu is popular for whole integer outputs, but have not used it yet.
Sent from my iPhone
On Jul 26, 2016, at 8:37 AM, Yurii Shevchuk notifications@github.com wrote:
I think it also can be useful to check the residuals between raw output from the network (without rounding) and target values. Based on it you can try to figure out how to make a better way to transform raw output from the network. Of course, it's possible only in case if your residuals aren't normally distributed with mean located near the 0.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
One of the main advantages of ReLu over the Sigmoid function is that it's less likely to vanish the gradient (vanishing means that values in gradient become very close to 0). Vanishing makes training slower. I'm not sure that ReLu will help you to fix this issue.
It seems that there is a heavy bias towards 0 in the dataset, so I'm not sure that anything can be done about that.
Sent from my iPhone
On Jul 26, 2016, at 8:55 AM, Yurii Shevchuk notifications@github.com wrote:
One of the main advantages of ReLu over the Sigmoid function is that it's less likely to vanish the gradient (vanishing means that values in gradient become very close to 0). Vanishing makes training slower. I'm not sure that ReLu will help you to fix this issue.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I have been playing around with different things with the neupy library, so this network is arbitrary in purpose, however models the overall set up of the real ones. This code was just to get the dill dump/load figured out. The code is