c# - Recommended Optimization package for ILNumerics -


i starting code own machine learning package, adopting ilnumerics.

i neural nets, svm, kernel methods , start moving more bayesian frameworks.

i know ilnumerics offers 'machine learning toolbox', add contribution , code own algorithms, because of features not present (yet?)

first, if understand well, of no optimization package included. hope wrong; if not case, suggestions on how implement through ilnumerics highly appreciated; mean: mixing pre-existing code impact performance? advisable mix ilarray , other vectors/matrices? adhering recommendations provided in quick guide enough leverage on excellent performance?

or, if prefer, recommend pre-built available optimization package/library used in conjunction ilnumerics?

thanks lot hints/advice, recommendations usual,

gl

you right in points. there no optimization package available in ilnumerics. however, know, 1 big advantage of .net ease of incorporation of external packages. several options exist here:

pinvoke (native modules)

since existing optimization packages exist native modules, pinvoke friend. several tools exist automatic dllimport signature generation. personally, prefer create signatures manually. especially, since scientific packages expose simple signature incorporated .net. hoever, problems can arise callbacks native managed code , marshalling of complex structs. (so , solve them all...

.net modules

you may find existing .net optimization module. see post (free optimization library in c#) or try microsoft solver foundation. better modules may exist - haven't looked while. unless implementation done carefully, may or may not suffer on performance due poor (none) memory management. (as far know, no other project tracks memory same efficient way ilnumerics does?). however, interfacing libraries easy enough: no need dllimport signatures. in order profit ilnumerics memory management, have manage arrays memory on 'ilnumerics' side. so, pattern give system.array other .net function be:

 .... inside ilnumerics function  using (ilscope.enter(inparameter1,inparameter2)) {     ....     ilarray<double> = zeros(1000,1000);  // allocate memory external use     var aarray = a.getarrayforwrite();     // fetch reference underlying system.array       callotherlib(aarray);                  // let other lib use , fill array     // proceed a...      return + 1 * 2 ... ;   } 

if other lib reading given array only, a.getarrayforread() may give better performance. using scheme, efficient memory usage ensured - @ least on ilnumerics side of implementation.

mixing data structures both sides not harm - doesn't bring advantage either: diminishes convenient syntax, since there no combined operators mixed matrix implementations. also, forced break down matrix accesses elementwise operations potentially lead less performant solution. so, recommend modular design seperated apis.

the memory scheme above applicable (and recommended) interfacing native libs.

using ilnumerics only

another way - of course - reimplement module on own, using ilnumerics builtin functions , array features. way obligatory, in order packages getting incorporated official ilnumerics distribution. brings several advantages: 1 can utilize convenient ilnumerics syntax, automatically profits efficient ilnumerics memory management , code platform independent @ end. also, gives flexibility regarding needed features algorithm.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -