loading and using a pre-trained neural network from any platform - neural-network

I am building a code and trying to keep things as generic as possible. I have seen a number of tutorials and post but they are all platform specific (tensorflow\pytorch).
Is there a good way to load and use a previously trained neural network model in a manner that the code will be able to cope with both torch and tensorflow? Does it matter in which version of tensorflow\torch the network was built in? I want the code to be as generic as possible.
Also, do I need to know the structure of the original network or can I load it and use it without the notion of the structure?

I don't think it is possible to write a program that can load pre-trained models from both Torch and Tensorflow as they save in different formats.
You might want to look into the Open Neural Network Exchange Format (https://onnx.ai/) if you are creating the models yourself, this is an initiative backed by Amazon, Facebook, Microsoft, and others to create a portable file format for deep learning models.

Related

learn training file new letters in windows (for c# app)

I would like to learn my training file for tesseract new letters. I want use win 10 (I won't use linux) - for use tesseract Nuget-package in c#.net app.
I tried jTessBoxEditor but it's not working (first time error in registry, than cannot found fonts, than problem with java, than text2image doesn't work properly...). Editor SunnyPage could not even load the image without fail.
which program use for separating letters and creating training file as windows user
should I use tesseract or other OCR engine? It looks like tesseract isn't windows-user friendly
please post example training file for this three images - if there is any need of preprocessing (scale etc.) it should be done programaticaly (c#.net)
Which program use for separating letters and creating a training file?
Try this one: https://github.com/skotz/captcha-breaking-library
or:
OpenCV
OpenCV is a popular framework for computer vision and image processing. It is easy to use OpenCV to process the CAPTCHA images. It has a Python API so you can use it directly from Python.
Keras
Keras is a deep learning framework written in Python. It makes it easy to define, train and use deep neural networks with minimal coding.
TensorFlow
TensorFlow is Google’s library for machine learning. If you will be coding in Keras, but Keras doesn’t actually implement the neural network logic itself. Instead, it uses Google’s TensorFlow library behind the scenes to do the heavy lifting.
This involves either brute-forcing the captcha or running OCR algorithms on it to try and detect what is written in the captcha.
If you want to implement your own CAPTHA an algorithm please look into that abstract: http://cmp.felk.cvut.cz/~cernyad2/TextCaptchaPdf/DESIGNING%20CAPTCHA%20ALGORITHM%20SPLITTING%20AND%20ROTATING.pdf
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.800.3065&rep=rep1&type=pdf

what is the typical size of pre-trained image classification model size

I have a few general questions regarding using pre-trained image classification models in mobile.
How big is a typical pre-trained model?
If it is too big for mobile, what is the best strategy from there?
I checked out the documentation of DeepLearning for Java, anywhere to download pre-trained model?
Thanks in advance.
It's really task dependent. I mean..you can't just say given an unknown problem what is an arbitrary size of neural net.
In general, if you're doing vision expect to be hundreds of megs, but a lot of it comes down tot he activation sizes. I would advise just doing some benchmarking overall. You can't really just handwave that.
A lot of the pretrained models are for computer vision only. They are based on keras. You shouldn't "download" them yourself. No framework works like that.
We have a managed module for that in the model zoo you should use instead.

A Simple Tool to Train and Test Neural Networks

I’m looking a simple tool to train and test neural networks for classification tasks. It need not be very sophisticated tool and I just want to train and test simple data sets such as given in the following web site.
http://www.stats.ox.ac.uk/pub/PRNN/
It's not a pre-made utility, but you could roll your own quite quickly using the Encog neural network framework (for both Java and .NET).
I've used it before and it was quite easy to get to grips with. The documentation is quite good, and if you need it, I've also found support on the forums to be good.
* UPDATE *
I just remembered that Encog does actually ship with a pre-made utility called Encog Workbench, which should do what you want.

Octave/Matlab solution for analyzing data coming from network

I am currently doing some research which involves analyzing data coming from different sensors. The way the data is provided is via a network interface. I want to take advantage of the already written procedures available in matlab/octave (error computing, plotting etc).
Which one is the best approach for doing such things:
doing an application in another language and call octave/matlab functions with data received from network?
doing an application in octave/matlab which handles incoming data from network interface?
...
Any other solutions and experiences are highly appreciated.
Thank you,
Iulian
LATER EDIT:
I am more interested in using octave than matlab but currently I'm looking to see a working method.
I've not used it, but there's a sockets package for Octave. If this works, writing the whole application in Octave seems easier to me than dealing with cross-language calling.
The "doing an application in octave/matlab which handles incoming data from network interface?" should be (fairly) easy, as you can easily use Java objects in MATLAB. You can use the Java network interfaces (or possibly a wrapper around them, if that makes it easier for you). I've worked on projects that take this approach to have Java threads handle all the networking and allowing MATLAB to grab results from the Java periodically and display/process them.

easiest tool to use for a extreme beginner for classification/clustering

I saw that the tool weka is having a gui interface. This gui interface is very easy for non coding users to classify data sets into classes. Matlab is very difficult since say for example making a neural network you need to write code and to do that you need to have a solid understanding of whats going on. Are there other tools like weka or else is there a plugin to matlab that gives more power to it?
RapidMiner has a functional GUI, and will work for both classification and clustering. It is the most popular open-source (free) data mining application available as of 2012.
RapidMiner: http://rapid-i.com/
It also has numerous training videos and tutorials that you can follow along with - I learned basic clustering methods using a K-means cluster method in about 3 hours. See the Vancouver Data blog for some great RapidMiner analytics videos. Top-notch stuff, really.
Vancouver Data (Neil McGuigan): http://vancouverdata.blogspot.com/
As a bonus, you can install the Weka plug-in, which then gives you GUI Weka. All of the add-ons are free and well-integrated. Other add-ons include a GUI 'R' (the stats program), Reporting Services, Text and Web Analytics, etc. It is fairly simple to use straight 'out of the box' (IMO).
Weka is very (very) powerful and you can write your own classifier if that's what you need to do.
Between Matlab and Weka there's pretty much nothing you can't do in terms of Machine Learning.
You might want to check out Netlab toolkit for Matlab, which is a neural network toolkit developed by a Professor at Aston University - it is available from http://www1.aston.ac.uk/eas/research/groups/ncrg/resources/netlab/