threshold algorithm - histogram

Does anyone know of any reference or sample code of the "Minimum Error Thresholding" algorithm? Java has a method called "getMinErrorThreshold" in the Histogram class and I want to implement this algorithm in C.
Thank you
Alessandro Ferrucci

Maybe just look at the java source?
http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules/Java-Advanced-Imaging/javax/media/jai/Histogram.java.htm

Related

bayesianoptimization in machine learning

Thanks for reading this. I am currently studying bayesoptimization problem and follow the tutorial. Please see the attachment.bayesian optimization tutorial
In page 11, about the acquisition function. Before I raise my question I need state my understanding about bayesian optimization to see if there is anything wrong.
First we need take some training points and assume them as multivariable gaussian ditribution. Then we need use acquisiont function to find the next point we want to sample. So for example we use x1....x(t) as training point then we need use acquisition function to find x(t+1) and sample it. Then we'll assume x1....x(t),x(t+1) as multivariable gaussian ditribution and then use acquisition function to find x(t+2) to sample so on and so forth.
In page 11, seems we need find the x that max the probability of improvement. f(x+) is from the sample training point(x1...xt) and easy to get. But how to get u(x) and that variance here? I don't know what is the x in the eqaution. It should be x(t+1) but the paper doesn't say that. And if it is indeed x(t+1), then how could I get its u(x(t+1))? You may say use equation at the bottom page 8, but we can use that equation on condition that we have found the the x(t+1) and put it into multivariable gaussian distribution. Now we don't know what is the next point x(t+1) so I have no way to calculate, in my opinion.
I know this is a tough question. Thanks for answering!!
In fact I have got the answer.
Indeed it is x(t+1). The direct way is we compute every u and varaince of the rest x outside of the training data and put it into acquisition function to find which one is the maximum.
This is time consuming. So we use nonlinear optimization like DIRECT to get the x that max the acquisition function instead of trying one by one

optimizer.compute_gradients how the gradients are calculated programatically?

I'm new to machine learning.I was going through tensorflow and i have a doubt on a particular function.
grads_and_vars = optimizer.compute_gradients(loss) can someone explain how the gradients are calculated programatically(i.e what formula does it use to compute the gradients)?
Tensorflow uses an algorithm called reverse-mode automatic differentiation. It's too complex a topic to explain here, but the Wikipedia page is a good starting point:
https://en.wikipedia.org/wiki/Automatic_differentiation
Hope that helps!

deeplearing4j with SVHN dataset

I try to model a CNN with deeplearing4j using SVHN dataset (http://ufldl.stanford.edu/housenumbers/), in particular I'm using
Format 2: Cropped Digits
This is matlab's files and each one contains a struct with a tensor (4-D) and an array with label. I would open this one into my deeplearing4j code, so I wondered and I find this class MatlabRecordReader.java into deeplearning4j/DataVec (https://github.com/deeplearning4j/DataVec/blob/master/datavec-api/src/main/java/org/datavec/api/records/reader/impl/misc/MatlabRecordReader.java) but I can't understand how use it. Anybody has experience whit this?
Thanks in advance
Here is a reference for "datavec":
http://deeplearning4j.org/DataVec
So if you look at:
http://nd4j.org/tensor
All of deeplearning4j's neural nets are written using nd4j (matlab for java) so this should be pretty easy to map.
You'll see it more or less maps to matlab.
What might be easier is if you could just write out the values as a csv
and reshape them to be the proper value instead. If you use c ordering it should work fine.
If you do that you can just use the csvrecord reader.
That matlab record reader hasn't been used by a lot of people and I think may only work with matrices (it's been a while)
I would try the csv one first.

USAN filter in OpenCV - custom filter

I'm trying to implement SUSAN corner detector in OpenCV Details here.
So far I have the filtering function, but there is a problem, that this is not an linear operation. According to documentation it's possible to use FilterEngine and BaseFilter to write custom filters. There are unfortunately no detail how to implement the filtering function dst(x,y) = F(src x kernel). I'm using C++ and OpenCV 2.3.
Thanks in advance.
A nice tutorial how to implement custom 2D filter based on kernel convolution is here!

Regarding use of cvStereorectify

I am trying to use cvstereorectify (link) to give me the Q matrix that I could then use back in cvReprojectImageto3D.
In the documentation of cvstereorectify though I am unsure how to get the R & T- The rotation matrix and the translation vector between the two cameras.Are there any methods that can help me do this? Any guidance is appreciated.
Use StereoCalibrate

Resources