tomitomi3 / liboptimization Goto Github PK
View Code? Open in Web Editor NEWLibOptimization is numerical optimization algorithm library for .NET Framework. / .NET用の数値計算、最適化ライブラリ
License: MIT License
LibOptimization is numerical optimization algorithm library for .NET Framework. / .NET用の数値計算、最適化ライブラリ
License: MIT License
反復回数を0にするのではなくAPIにしたほうが良い。
A new perspective for optimization is proposed based on the mathematics of heat transfer
http://www.sciencedirect.com/science/article/pii/S0020025515004764
Namespace Optimization
...
Public MustInherit Class absOptimization
...
Protected m_rand As System.Random = New clsRandomXorshift(CUInt(Environment.TickCount))
Environment.TickCount
can actually return negative number (it does at my machine).
There should be
Protected m_rand As System.Random = New clsRandomXorshift(BitConverter.ToUInt32(BitConverter.GetBytes(Environment.TickCount), 0))
VCS simulates diffusion and infection strategies for the host cells adopted by virus to survive and propagate in the cell environment.
http://www.sciencedirect.com/science/article/pii/S0965997815001702
Today, when initializing DE with upper and lower bounds, points are evaluated twice. This is inefficient and noticeable when evaluation is expensive.
Today's process:
clsOptDE.Init()
: generate a random point using initial value rangesclsPoint
You can see the point is evaluated twice, in steps #2 and #4
Ideal process:
In this flow the point is only evaluated once.
There is a secondary bug with the limit function where the random point is not uniformly sampled from the upper and lower bounds. Instead it is uniformly sampled from the initial value ranges, so if the upper and lower bounds are wider, you miss parts of those bounds, and if the bounds are narrower, you are more likely to get "random" points from the edge of the bounds.
Roach Infestation Optimization
ワモンゴキブリなどの一般的なゴキブリの行動に大まかに基づく数値最適化アルゴリズム
対角成分だけになっているのを修正
CMA-ES
共分散行列適応進化戦略、Covariance Matrix Adaptation Evolution Strategy
git-flow
https://nvie.com/posts/a-successful-git-branching-model/
デフォルトブランチをdevelopへ
TODO:NSGA
NSGA for Multi objective optimization.
*NSGA(Non-dominated Sorting Genetic Algorithm)
assembly.infoが更新されていないためバージョンが古く見える。
Hello,
I would like to use Liboptimization for a 2 variables function in my vb.net code.
I've coded my function f(x,y), but then, the syntax
Dim optimization As New clsOptDEJADE(New f( ))
is not correct, as the two parameters x and y are needed, and have to be declared. Could you give an example with a customize function please?
Kazu
初期値のプロパティがあった場合、値を足していた。
If MyBase.InitialPosition IsNot Nothing AndAlso MyBase.InitialPosition.Length = Me.m_func.NumberOfVariable Then
value += Me.InitialPosition(j)
End If
集団の中で1つだけ設定しても効果が薄いと思うので、集団の1/10を初期値に書き換えるようにする。
値を出力するようにする
多次元配列を入れて初期化できるようにする。
var mat = new DenseMatrix( array[3,3] );
TODO:NSGAII
NSGAII for Multi objective optimization. NSGAII that improved NSGA.
MS-PLからMITへ変更する。
ライセンス変更に伴うデメリットは特にない。
制約条件の追加。
強い要望がある。
.NET Core対応に向けて全てC#化
シリアライズして途中結果を保存できるようにする。
overview
Bayesian Adaptive Direct Search
Refference
hi, tomi, your project is really awesome
i'm trying to simulate this R code in vb.net
dp <- garch_test$X__1
llh <- function(par) { mu <- par[1]; omega <- par[2]; alpha <- par[3]; beta <- par[4]; e2 <- (dp-mu)^2; e2t <- omega + alphac(mean(e2), e2[-length(dp)]); s2 <- filter(e2t, beta, "recursive", init = mean(e2)); 0.5sum( log(2pi) + log(s2) + e2/s2) }
mu <- mean(dp); omega <- 0.1var(dp); alpha <- 0.1; beta <- 0.8
par <- c(mu, omega, alpha, beta)
small <- 1e-6
low <- c(-10abs(mu), small, small, small)
up <- c(10abs(mu), 100*abs(mu), 1-small, 1-small)
fit <- nlminb(start=par, objective=llh, lower=low, upper=up, control=list(x.tol = 1e-8,trace=0))
names(fit$par) <- c("mu", "omega", "alpha", "beta")
round(fit$par, 6)
nlminb optimization method allows initial parameter values and low/up bound of parameters
it converges really fast
any of your method allows this options?
i tested clsOptDE and gets a really accurate values, but does not converge so fast
thanks in advance
Good afternoon.
The question of how to maximize the function?
Example: z = 3 * Math.Pow((1 - x), 2) * Math.Exp(-(Math.Pow(x , 2)) - Math.Pow((y + 1) , 2)) - 10 * (x / 5 - Math.Pow(x , 3) - Math.Pow(y , 5)) * Math.Exp(-Math.Pow(x , 2) - Math.Pow(y , 2)) - 1 / 3 * Math.Exp(-Math.Pow((x + 1) , 2) - Math.Pow(y , 2));
エラー関係を見直し。
例外を投げるようにした方が良さそう。
It is the same simple as the greedy Hill-Climbing, but much more powerful.
In the SampleVB project there is this code for using clsOptDE, with two Console write-line statements I added:
'LeastSquaresMethod 最小二乗法
With Nothing
Console.WriteLine("------------------------------ BEGIN: DATA.CSV --------------------")
'評価関数
Dim objectiveFunction = New clsLeastSquaresMethod()
If objectiveFunction.Init("..\..\..\_sampledata\data.csv") = False Then
Return
End If
'最小化
Dim opt As New LibOptimization.Optimization.clsOptDE(objectiveFunction)
opt.Init()
LibOptimization.Util.clsUtil.DebugValue(opt)
While (opt.DoIteration(50) = False)
LibOptimization.Util.clsUtil.DebugValue(opt, ai_isOutValue:=False)
End While
LibOptimization.Util.clsUtil.DebugValue(opt)
Console.WriteLine("------------------------------ END: DATA.CSV --------------------")
End With
When I run the program I get:
------------------------------ BEGIN: DATA.CSV --------------------
TargetFunction:clsLeastSquaresMethod Dimension:5
OptimizeMethod:clsOptDE
Eval :59438373.1751817
IterationCount:0
Result :
-0.0158704898822757
-0.381333913044383
4.93756533831767
-4.28593948466842
3.24185321532233
Eval :1429.78513592157
Eval :0.956465983765879
Eval :0.000497619640101209
Eval :3.08647227393116E-07
Eval :1.38365563205351E-10
Eval :1.84394063162285E-13
Eval :1.06744757544432E-16
Eval :4.16369815393116E-20
Eval :2.33202429712711E-23
TargetFunction:clsLeastSquaresMethod Dimension:5
OptimizeMethod:clsOptDE
Eval :3.04300885378471E-24
IterationCount:460
Result :
0.0499999999999999
0.999999999999999
-9.99999999999997
-99.9999999999999
99.9999999999983
------------------------------ END: DATA.CSV --------------------
Can someone tell me how this relates to the data found in data.csv, the data file used with the object function?:
x,y
-20,-1900
-19.8,-1918.02392
-18.8,-1953.08032
-7.2,62.72128
3.8,-359.10232
7.2,-630.78272
I'm trying to figure out how to use clsOptDE with my app, where I need to call a particular function (the "fitness" function in GA terms) that analyzes a particular test vector against my fitness function. My fitness function uses the field values in the test vector to run a test against a data set.
ベクトルと行列のテストコードを追加したい。
.NET Core対応
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.