I am trying to integrate Rosenzweig-MacArthur model (equations) using Backward Differentiation Method using CVODE in C for stiff equations. I have to specify tolerance value for integration. Depending on the tolerance value I give, I get different solutions. I am not able to see which one is the correct solution. Can you please tell me what should (criteria for choosing) the tolerance value be?
Related
I'm using caffe to do the object detection with SSD model, and recently work I adjust the loss type of "MultiBoxLoss".
In the multibox_loss_layer.cpp file, its loss has SOFTMAX as default and LOGISTIC option, I add the hingeloss(SVM) option into caffe code, and do the training but the result is bad.
Now the boss want me to use SVM to classify the feature map by python sklearn.
And a question come across to me, in the multibox_loss_layer.cpp file, there can use the softmax, logistic and hingeloss to calculate the loss. On this step, its data is just "one-dimension", but the feature map is high-dimension, and I internet the article, it seem softmax can't classify high-dimension data.
Ex: if there have three class: cat, dog and rabbit, then it's one-dimension data just have three value to represent cat, dog and rabbit(one value for each class), but the high-dimension data, it have many value(like feature map) for each class, and on the high-dimension case, softmax seems have no work for this.
so I wonder what's the different between softmax, logistic and SVM. Can anybody help? thank you!
Never seen applying SVM loss function into NN. However softmax is a loss function which should be used in order to optimize solution multiclass classifiaction problem. Softmax "transform" NN outputs into probability of each class occurance. Logistic function usually optimize each neuron output as a logistic problem, so it's not force output to be only one class. You should use this function if you want to solve multi labeling problem.
SVM is not a function, is a different classifier. There is no sense in comparing softmax with SVM, because first one is a loss function second one is a classifier.
All. Forgive me I am a newbie in Solr, I am trying to add spell check in the Solr.
Currently I can say it works .But I got a problem which the suggestion is not showing up as I expected.
I tried to search with the keywords lu. and expect the suggestion lung in the result. But it doesn't show up.
the Url is http://10.2.21.38:7574/solr/gettingstarted_shard1_replica2/spell?q=lu&spellcheck=true&spellcheck.collate=true&spellcheck.build=true
Only when I tried with lun. It can return suggestion lung.
Any idea to get it work? Thanks.
Updated
It seems it has something with the configuration <str name="accuracy">{number}</str> the original value is 0.7. When I changed it to smaller value like 0.001 . keywords lu can get the suggestion lung.
But I want to know what does it mean for the accuracy. The document only say a little about it .The accuracy setting defines the threshold for a valid
suggestion. That is it.
Could someone please tell me more about it for better understanding . and Is there any other configuration to affect the suggestion result ? Thanks.
The accuracy setting refers to the value that the active StringDistance calculator returns (which is between 0 and 1, depending on similarity). The standard distance measurer in Lucene is the LevensteinDistance (sic). I'll refer to the source to see how it works - I'm not intimately familiar with the code. The returned value is at least based on:
return 1.0f - ((float) p[n] / Math.max(other.length(), sa.length));
Where p[n] is calculated through the iteration above in the code.
You can change most implementations in the spellchecker, such as the distance measurer or the spellchecker itself. See Spell Checking for examples. maxEdits and minPrefix might be interesting as well. Also, remember that lu and lung have a fairly large difference, as both terms are short and not really misspellings of each other. There are other ways of doing automagic completion, such as the Suggest module or wild card searching against a StrField or a KeywordTokenizer-ed field.
I am currently trying to write a code to solve a non linear system of equations. I am using the functions of the gsl library, more specifically the multiroot_fdf_solver.
My problem is that it currently doesn't want to converge. More specifically, I have the following behavior:
-if my initial conditions are close to the result, the gsl_multiroot_fdf_solver_iterate does not update the parameters at all. I tried to display the results on the different steps, and I have for all the parameters dx = NaN (I think this quite srange), the status of gsl_multiroot_fdf_solver_iterate is "success" and the status of gsl_multiroot_test_residual is "the iteration has not converged yet"
-the parameters are only updated if my initial conditions are really far from the expected result. Obvisously in this case it does not converge to the right values.
I have already checked multiple times the expression of my function and my Jacobian, and they seem good.
I have to precise that my Jacobian (and my system as well) are quite complicated expression with many trigonometric function.
Would you have any idea of what it could be? Is it possible that if the expression of the Jacobian is too complicated, it has troubles to compute it?
Thank you in advance for your answers, I am really stucked at this point.
I have to solve the following nonlinear coupled partial differential system (link). All the functions are better explained here.
Even if I use the finite difference method (i.e. central difference in space and forward Crank-Nicholson in time in order to obtain an implicit scheme) I don't know how to linearize the problem (I have to solve a nonlinear system: I tried using Newton method, but sometimes I get a singular Jacobian; moreover, the function tau(lambda) is a non-convex energy, so I'm near a spinoidal point). Could you suggest some method?
Thanks in advance for all your help.
Petrus
I'll be writing the online Google test tomorrow as a fresher. Apparently, they definitely ask one problem on Dynamic Programming?
Does anyone know of a good resource for collection of DP problems in C along with solutions? I know what DP is & have used it on an occasion or twice. However I feel to crack a DP problem in test, prior practice of typical problems will make it easier to approach.
Any good resources or problem sets with solutions in C will be highly appreciated. Thanks.
Okay, so I really hope this doesn't count as "shameless self-promotion," since all of these links are to code snippets I've posted on my personal site. If this is inappropriate, please let me know and I can take them down.
Here are a few fun DP problems that are pretty much classics:
Minimum edit distance: Given two strings A and B, find the shortest number of edits (insertions, deletions, or substitutions) necessary to convert A into B. This is called the Levenshtein distance. (My solution)
Optimal sequence alignment: Given two strings A and B, find the minimum number of gaps that must be inserted into the sequence to align A and B. This is called the Needleman-Wunsch algorithm. (My solution)
Single-source shortest paths: Given a directed graph G and a single node s, find the lengths of the shortest paths from s to each other node in the graph, assuming edges can be positive or negative but that no cycles exist. This is the Bellman-Ford algorithm. (My solution)
All-pairs shortest paths: Given a directed graph G, find the minimum distances between all pairs of nodes. This is the Floyd-Warshall algorithm. (My solution)
Hopefully this is somewhat useful, and best of luck tomorrow!
The Topcoder website is amazing. Not all of the problems use DP, but many do. Free full access to all problems from past competitions, which are at 3 different difficulty levels, as well as after-match explanations of every single problem from the problem author. Not only that, but you can quickly dig up the source code solution submitted by any coder in the competition.
Haven't been back there for a while, but they allow at least C++, Java, C# and I believe several other languages now.
I suggest u,collect a book "An Introduction to Bioinformatics Algorithms".This has a chapter fully on DP.As #templatetypedef mentioned Minimum edit distance,Optimal sequence alignment it has other problem with them.Though there is no implementation in it.You have to do it on your own.But you will find pretty interesting reading them.
To practice you can take one of the available problems at SPOJ. To recognize DP ones easily you can check at Problems Classifier (keyword: dp).