A direct Java port of liblbfgs

lbfgs4j is a Java version of liblbfgs, a library of Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS).

Лицензия

Лицензия

MIT License
Группа

Группа

com.github.vinhkhuc
Идентификатор

Идентификатор

lbfgs4j
Последняя версия

Последняя версия

0.2.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

A direct Java port of liblbfgs
lbfgs4j is a Java version of liblbfgs, a library of Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS).
Ссылка на сайт

Ссылка на сайт

http://maven.apache.org
Система контроля версий

Система контроля версий

https://github.com/vinhkhuc/lbfgs4j

Скачать lbfgs4j

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.vinhkhuc/lbfgs4j/ -->
<dependency>
    <groupId>com.github.vinhkhuc</groupId>
    <artifactId>lbfgs4j</artifactId>
    <version>0.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.vinhkhuc/lbfgs4j/
implementation 'com.github.vinhkhuc:lbfgs4j:0.2.1'
// https://jarcasting.com/artifacts/com.github.vinhkhuc/lbfgs4j/
implementation ("com.github.vinhkhuc:lbfgs4j:0.2.1")
'com.github.vinhkhuc:lbfgs4j:jar:0.2.1'
<dependency org="com.github.vinhkhuc" name="lbfgs4j" rev="0.2.1">
  <artifact name="lbfgs4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.vinhkhuc', module='lbfgs4j', version='0.2.1')
)
libraryDependencies += "com.github.vinhkhuc" % "lbfgs4j" % "0.2.1"
[com.github.vinhkhuc/lbfgs4j "0.2.1"]

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.11

Модули Проекта

Данный проект не имеет модулей.

This is a direct Java port of liblbfgs, a library of Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS).

The L-BFGS optimization method is used to solve unconstrained minimization problem:

                    minimize f(x), where x = (x1, x2, ... xn)
                    f(x) and its gradient are computable.

This library also includes the implementation of the Orthant-Wise Limited-memory Quasi-Newton (OWL-QN) method which is used to minimize the function f(x) + C|x|, where C is a positive number.

Maven dependency

<dependency>
  <groupId>com.github.vinhkhuc</groupId>
  <artifactId>lbfgs4j</artifactId>
  <version>0.2.1</version>
</dependency>

Usage example

Find the minimum value of the function f(x) = (x-5)^2 + 1.

import com.github.lbfgs4j.liblbfgs.Function;
import com.github.lbfgs4j.LbfgsMinimizer;
...

Function f = new Function() {
  public int getDimension() {
    return 1;
  }
  public double valueAt(double[] x) {
    return Math.pow(x[0]-5, 2) + 1;
  }
  public double[] gradientAt(double[] x) {
    return new double[] { 2*(x[0]-5) };
  }
};

LbfgsMinimizer minimizer = new LbfgsMinimizer();
double[] x = minimizer.minimize(f); // x should be [5]
double min = f.valueAt(x);          // min should be 1

The OWL-QN method will be used when initializing the minimizer with, for example, new LbfgsMinimizer(1.0), here 1.0 is the coefficient for |x|.

Other parameters such as memory size, maximum number of iterations, etc. can be set using the class LBFGS_Param.

License

lbfgs4j is released under the MIT License (see the LICENSE file for details).

References

This library is used in several projects:

  1. Moment-Based Quantile Sketches for Efficient High Cardinality Aggregation Queries. Edward Gan, Jialin Ding, Kai Sheng Tai, Vatsal Sharan, Peter Bailis. VLDB 2018. (paper)
  2. Humio, Log Management at Scale. (acknowledgement)

Версии библиотеки

Версия
0.2.1
0.2
0.1