I currently trying to create a neural network of my own. I have managed to get the network to work to a degree but to the best of my knowledge I seem to be stuck in a local minima when I run the program or atleast output spitted out by the net seems to be changing at a very very slow pace. The pace changes/ or I get better output as I add more nodes in the hidden layer can anyone suggest or have a look at my code to see why it's not working with 2 nodes in hidden layer. And why do I have to add more node in the hidden layer for it to give decent mse.
Thank you in advance.
this is the mse at the end of 100000 iteration with 2 nodes :
0.07402
0.07402
0.07402
so on and on. As you can see mse should be around 0.001 but its quite high.
link to the code!
Alright, I solved it all it need was bias used this link to help myself code. link!
Related
I watched some many videos on proper codes for generating cross-validation likelihood when smooth kernel a curve and non of the package works well. I need simple codes let's say using "mtcars". Any help with that, please? And if I can change the bandwidth (h) what code to use?
I tried caret but did not work. I hope you can give me proper codes using mtars so I can use the codes for any data I may have.
I have images that look as follows:
My goal is to detect and recognize the number 31197394. I have already fine-tuned a deep neural network on text recognition. It can successfully identify the correct number, if it is provided it in the following format:
The only task that remains is the detection of the corresponding bounding box. For this purpose, I have tried darknet. Unfortunately, it's not recognizing anything. Does anyone have an idea of a network that performs better on these kind of images? I know, that amazon recognition is able to solve this task. But I need a solution that works offline. So my hopes are still high that there exist pre-trained networks that work. Thank's a lot for your help!
Don't say darknet doesn't work. It depends on how you labeled your dataset. It is true that the numbers you want to recognize are too small so if you don't make any changes to the image during the pre-processing phase, it would be complicated for a neural network to recognize them well. So what you can do that will surely work is:
1---> Before labeling, increase the size of all images by 2 times its current size (like 1000*1000)
2---> used this size (1000 * 1000) for the darket trainer instead of the default size proposed by darknet which is 416 * 416. You would then have to change the configuration file
3---> use the latest darknet version (yolo v4)
4---> On the configuration file, always keep a number of subdivisions at 1.
I also specify that this method is too greedy in memory, it is therefore necessary to provide a machine with RAM > 16 GB. The advantage is that it works...
Thanks for your answers guys! You were right, I had to finetune yolo to make it work. So I created a dataset and fine-tuned yolov5. I am surprised how good the results are. Despite only having about 300 images in total, I get an accuracy of 97% to predict the correct number. This is mainly due to strong augmentations. And indeed the memory requirements are large, but I could train on a 32 GM RAM machine. I can really encourage anyone who faces similar problems to give yolo a shot!!
Maybe use an R-CNN to identify the region where the number is and then pass that region to your fine-tuned neural network for the digit classification
I want to create a valve detection and classification like this video : https://www.youtube.com/watch?v=VY92fqmSdfA
to detect the positions Open and close and intermediate of the valve.
I have done some research and I have found some methods to resolve this problem, but i have some conditions to respect to resolve this problem :
Condition 1 : Use machine learning in the application, I can't use simple methods like Template matching,...
Condition 2 : Use a small database (Minimum 10 images by classe, maximum 40 images by classe)
Condition 3 : detect the position of the valve if the camera position changes, so I can't use only colors to detect the valve handle.
I want to use HOG (Histogram oriented gradient) + SVM/ANN but HOG needs a lot of images to train SVM/ANN.
I dont know if I can resolve this problem respecting this conditions?
As we know, the most important thing that ML approaches need to work properly is data. So, I'd say your 1st and 2nd conditions are conflicting with each other. In addition, your 3rd condition is adding more complexity in the problem. You can solve it including more data from different angles and illumination conditions. But again, it's conflicting with condition 2.
Even so, if you'd like to follow the ML path, I'd recommend you to use a pre-trained model, a strong data augmentation and, maybe, an ensemble of models to help increase the detection. As the problem is not that hard, it should work.
I would like to speedup the forward pass of classification of a CNN using caffe.
I have tried batch classification in Caffe using code provided in here:
Modifying the Caffe C++ prediction code for multiple inputs
This solution enables me to give a vector of Mat, but it does not speed up anything. Even though the input layer is modified.
I am processing pretty small images (3x64x64) on a powerful pc with two GTX1080, and there is no issue in terms of memory.
I tried also changing the deploy.prototxt, but I get the same result.
It seems that at one point the forward pass of the CNN becomes sequential.
I have seen someone pointing this out here also:
Batch processing mode in Caffe - no performance gains
Another similar thread, for python : batch size does not work for caffe with deploy.prototxt
I have seen some things about MemoryDataLayer, but I am not sure this will solve my problem.
So I am kind of lost on what to do exactly... does anyone have any information on how to speedup classification time.
Thanks for any help !
I am trying to understand how to create a basic, simple neural network in Python/Pygame. I have read this tutorial and my aim is to create a program similar to the program that is described in "AI junkie". Although this tutorial is pretty simple. I still don't fully get it, and I am not sure about the connection between the output of the neurons to the movement of the tanks. Where can I find a simple, basic code of a program like this written in pygame/python, to try improving my understanding of the implementation of the algorithm?
Thanking you in anticipation!
Check #Nathan's Python code in this post. It's pretty clean and also good to take as a start point.
If you want logistic activation:
def logistic(x):
return 1/(1+math.exp(-x))
# derivative of logistic
def dlogistic(y):
return y*(1-y)
The default activation function is tanh in the original code.
It's quite straightforward to construct a network and start training:
# create a network with 5 inputs, 20 hiddens, and one output nodes
n = NN(5, 20, 1)