lbfgsb 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +16 -2
- data/lib/lbfgsb/version.rb +1 -1
- data/lib/lbfgsb.rb +2 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8b981810814f144065eb51dadf5c310ce4eaa5080e1cb4092189dbe916387bf
|
4
|
+
data.tar.gz: 1ba3ff6d1cfe6fe0e0a707963b39554d7ad2c1e8be8829d8eaf1918ffd743adf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 778a041c3072451e86dccd5d75850540fc2503d49f14e1a4c11db9c20f05f0d427627f2f17c5931fe90dba68ba3ab5760b4f59a811f5af19eb5f0ce12ab0891c
|
7
|
+
data.tar.gz: 01d735e9f03a3bc4615cf5b471a2c88bc210663b7d268edf0898c5936e50a2b636cfd8ee6e1664c6d225c6872aa7108bd00aece439629a4d5c691d90bd6e7913
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
[](https://github.com/yoshoku/lbfgsb.rb/actions?query=workflow%3Abuild)
|
4
4
|
[](https://badge.fury.io/rb/lbfgsb)
|
5
5
|
[](https://github.com/yoshoku/suika/blob/main/LICENSE.txt)
|
6
|
-
[](https://yoshoku.github.io/lbfgsb.rb/doc/)
|
7
7
|
|
8
|
-
Lbfgsb.rb is a Ruby binding for [L-BFGS-B](
|
8
|
+
Lbfgsb.rb is a Ruby binding for [L-BFGS-B](https://users.iems.northwestern.edu/~nocedal/lbfgsb.html)
|
9
9
|
that is a limited-memory algorithm for solving large nonlinear optimization problems
|
10
10
|
subject to simple bounds on the variables.
|
11
11
|
L-BFGS-B is written in FORTRAN. Author converted the codes into C-lang
|
@@ -27,6 +27,20 @@ Or install it yourself as:
|
|
27
27
|
|
28
28
|
$ gem install lbfgsb
|
29
29
|
|
30
|
+
Notes: lbfgsb.rb uses 32-bit integer for the integer type in its native code.
|
31
|
+
If you want to use 64-bit integer, give the installation option as below:
|
32
|
+
|
33
|
+
```
|
34
|
+
$ gem install lbfgsb -- --with-use-int64
|
35
|
+
```
|
36
|
+
|
37
|
+
In adition, if you want to use an external BLAS library for linear algebra on LBFGSB optimization,
|
38
|
+
give the directory and library in the installation options as follows:
|
39
|
+
|
40
|
+
```
|
41
|
+
$ gem install lbfgsb -- --with-blas-dir=/opt/local/openblas/lib --with-blas-lib=openblas
|
42
|
+
```
|
43
|
+
|
30
44
|
## Usage
|
31
45
|
Example 1. Logistic Regression
|
32
46
|
|
data/lib/lbfgsb/version.rb
CHANGED
data/lib/lbfgsb.rb
CHANGED
@@ -5,6 +5,7 @@ require 'numo/narray'
|
|
5
5
|
require 'lbfgsb/version'
|
6
6
|
require 'lbfgsb/lbfgsbext'
|
7
7
|
|
8
|
+
# Lbfgsb.rb is a Ruby binding for L-BFGS-B with Numo::NArray.
|
8
9
|
module Lbfgsb
|
9
10
|
module_function
|
10
11
|
|
@@ -39,7 +40,7 @@ module Lbfgsb
|
|
39
40
|
# - jcb [Numo::Narray] Values of the jacobian
|
40
41
|
# - task [String] Description of the cause of the termination.
|
41
42
|
# - success [Boolean] Whether or not the optimization exited successfully.
|
42
|
-
def minimize(fnc:, x_init:, jcb:, args: nil, bounds: nil, factr: 1e7, pgtol: 1e-5, maxcor: 10, maxiter: 15_000, verbose: nil)
|
43
|
+
def minimize(fnc:, x_init:, jcb:, args: nil, bounds: nil, factr: 1e7, pgtol: 1e-5, maxcor: 10, maxiter: 15_000, verbose: nil) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
43
44
|
n_elements = x_init.size
|
44
45
|
l = Numo::DFloat.zeros(n_elements)
|
45
46
|
u = Numo::DFloat.zeros(n_elements)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lbfgsb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yoshoku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02
|
11
|
+
date: 2022-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: numo-narray
|
@@ -59,6 +59,7 @@ metadata:
|
|
59
59
|
source_code_uri: https://github.com/yoshoku/lbfgsb.rb
|
60
60
|
changelog_uri: https://github.com/yoshoku/lbfgsb.rb/blob/main/CHANGELOG.md
|
61
61
|
documentation_uri: https://yoshoku.github.io/lbfgsb.rb/doc/
|
62
|
+
rubygems_mfa_required: 'true'
|
62
63
|
post_install_message:
|
63
64
|
rdoc_options: []
|
64
65
|
require_paths:
|
@@ -74,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
75
|
- !ruby/object:Gem::Version
|
75
76
|
version: '0'
|
76
77
|
requirements: []
|
77
|
-
rubygems_version: 3.
|
78
|
+
rubygems_version: 3.2.33
|
78
79
|
signing_key:
|
79
80
|
specification_version: 4
|
80
81
|
summary: Lbfgsb.rb is a Ruby binding for L-BFGS-B.
|