tomoto 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/LICENSE.txt +1 -1
- data/README.md +7 -0
- data/ext/tomoto/ct.cpp +54 -0
- data/ext/tomoto/dmr.cpp +62 -0
- data/ext/tomoto/dt.cpp +82 -0
- data/ext/tomoto/ext.cpp +27 -773
- data/ext/tomoto/gdmr.cpp +34 -0
- data/ext/tomoto/hdp.cpp +42 -0
- data/ext/tomoto/hlda.cpp +66 -0
- data/ext/tomoto/hpa.cpp +27 -0
- data/ext/tomoto/lda.cpp +250 -0
- data/ext/tomoto/llda.cpp +29 -0
- data/ext/tomoto/mglda.cpp +71 -0
- data/ext/tomoto/pa.cpp +27 -0
- data/ext/tomoto/plda.cpp +29 -0
- data/ext/tomoto/slda.cpp +40 -0
- data/ext/tomoto/utils.h +84 -0
- data/lib/tomoto/tomoto.bundle +0 -0
- data/lib/tomoto/tomoto.so +0 -0
- data/lib/tomoto/version.rb +1 -1
- data/vendor/tomotopy/README.kr.rst +12 -3
- data/vendor/tomotopy/README.rst +12 -3
- data/vendor/tomotopy/src/Labeling/FoRelevance.cpp +47 -2
- data/vendor/tomotopy/src/Labeling/FoRelevance.h +21 -151
- data/vendor/tomotopy/src/Labeling/Labeler.h +5 -3
- data/vendor/tomotopy/src/Labeling/Phraser.hpp +518 -0
- data/vendor/tomotopy/src/TopicModel/CTModel.hpp +6 -3
- data/vendor/tomotopy/src/TopicModel/DT.h +1 -1
- data/vendor/tomotopy/src/TopicModel/DTModel.hpp +8 -23
- data/vendor/tomotopy/src/TopicModel/HDPModel.hpp +9 -18
- data/vendor/tomotopy/src/TopicModel/HLDAModel.hpp +56 -58
- data/vendor/tomotopy/src/TopicModel/HPAModel.hpp +4 -14
- data/vendor/tomotopy/src/TopicModel/LDA.h +69 -17
- data/vendor/tomotopy/src/TopicModel/LDACVB0Model.hpp +1 -1
- data/vendor/tomotopy/src/TopicModel/LDAModel.hpp +108 -61
- data/vendor/tomotopy/src/TopicModel/MGLDAModel.hpp +7 -8
- data/vendor/tomotopy/src/TopicModel/PAModel.hpp +26 -16
- data/vendor/tomotopy/src/TopicModel/PT.h +27 -0
- data/vendor/tomotopy/src/TopicModel/PTModel.cpp +10 -0
- data/vendor/tomotopy/src/TopicModel/PTModel.hpp +273 -0
- data/vendor/tomotopy/src/TopicModel/TopicModel.hpp +16 -11
- data/vendor/tomotopy/src/Utils/MultiNormalDistribution.hpp +3 -2
- data/vendor/tomotopy/src/Utils/Trie.hpp +39 -8
- data/vendor/tomotopy/src/Utils/TruncMultiNormal.hpp +36 -38
- data/vendor/tomotopy/src/Utils/Utils.hpp +50 -45
- data/vendor/tomotopy/src/Utils/math.h +8 -4
- data/vendor/tomotopy/src/Utils/tvector.hpp +4 -0
- metadata +24 -60
@@ -153,28 +153,32 @@ namespace tomoto
|
|
153
153
|
inline float lgammaT(float x) { return detail::LUT_lgamma::get(x); }
|
154
154
|
inline float digammaT(float x) { return detail::LUT_digamma::get(x); }
|
155
155
|
|
156
|
+
// approximation : lgamma(z) ~= (z+2.5)ln(z+3) - z - 3 + 0.5 ln (2pi) + 1/12/(z + 3) - ln (z(z+1)(z+2))
|
156
157
|
template<class _T>
|
157
158
|
inline auto lgammaApprox(_T z) -> decltype((z + 2.5)* log(z + 3) - (z + 3) + 0.91893853 + 1. / 12. / (z + 3) - log(z * (z + 1) * (z + 2)))
|
158
159
|
{
|
159
|
-
// approximation : lgamma(z) ~= (z+2.5)ln(z+3) - z - 3 + 0.5 ln (2pi) + 1/12/(z + 3) - ln (z(z+1)(z+2))
|
160
160
|
return (z + 2.5) * log(z + 3) - (z + 3) + 0.91893853 + 1. / 12. / (z + 3) - log(z * (z + 1) * (z + 2));
|
161
161
|
}
|
162
162
|
|
163
|
+
// calc lgamma(z + a) - lgamma(z)
|
163
164
|
template<class _T, class _U>
|
164
|
-
inline
|
165
|
+
inline auto lgammaSubt(_T z, _U a) -> decltype((z + a + 1.5)* log(z + a + 2) - (z + 1.5) * log(z + 2) - a + (1. / (z + a + 2) - 1. / (z + 2)) / 12. - log(((z + a) * (z + a + 1)) / (z * (z + 1))))
|
165
166
|
{
|
166
167
|
return (z + a + 1.5) * log(z + a + 2) - (z + 1.5) * log(z + 2) - a + (1. / (z + a + 2) - 1. / (z + 2)) / 12. - log(((z + a) * (z + a + 1)) / (z * (z + 1)));
|
167
168
|
}
|
168
169
|
|
170
|
+
// approximation : digamma(z) ~= ln(z+4) - 1/2/(z+4) - 1/12/(z+4)^2 - 1/z - 1/(z+1) - 1/(z+2) - 1/(z+3)
|
169
171
|
template<class _T>
|
170
172
|
inline auto digammaApprox(_T z) -> decltype(log(z + 4) - 1. / 2. / (z + 4) - 1. / 12. / ((z + 4) * (z + 4)) - 1. / z - 1. / (z + 1) - 1. / (z + 2) - 1. / (z + 3))
|
171
173
|
{
|
172
|
-
// approximation : digamma(z) ~= ln(z+4) - 1/2/(z+4) - 1/12/(z+4)^2 - 1/z - 1/(z+1) - 1/(z+2) - 1/(z+3)
|
173
174
|
return log(z + 4) - 1. / 2. / (z + 4) - 1. / 12. / ((z + 4) * (z + 4)) - 1. / z - 1. / (z + 1) - 1. / (z + 2) - 1. / (z + 3);
|
174
175
|
}
|
175
176
|
|
177
|
+
// calc digamma(z + a) - digamma(z)
|
176
178
|
template<class _T, class _U>
|
177
|
-
inline
|
179
|
+
inline auto digammaSubt(_T z, _U a) -> decltype(log((z + a + 2) / (z + 2)) - (1 / (z + a + 2) - 1 / (z + 2)) / 2 - (1 / (z + a + 2) / (z + a + 2) - 1 / (z + 2) / (z + 2)) / 12
|
180
|
+
- 1. / (z + a) - 1. / (z + a + 1)
|
181
|
+
- 1. / z - 1. / (z + 1))
|
178
182
|
{
|
179
183
|
return log((z + a + 2) / (z + 2)) - (1 / (z + a + 2) - 1 / (z + 2)) / 2 - (1 / (z + a + 2) / (z + a + 2) - 1 / (z + 2) / (z + 2)) / 12
|
180
184
|
- 1. / (z + a) - 1. / (z + a + 1)
|
@@ -172,10 +172,14 @@ namespace tomoto
|
|
172
172
|
|
173
173
|
reverse_iterator rbegin() noexcept { return reverse_iterator(_last); }
|
174
174
|
|
175
|
+
const_reverse_iterator rbegin() const noexcept { return reverse_iterator(_last); }
|
176
|
+
|
175
177
|
const_reverse_iterator crbegin() const noexcept { return reverse_iterator(_last); }
|
176
178
|
|
177
179
|
reverse_iterator rend() noexcept { return reverse_iterator(_first); }
|
178
180
|
|
181
|
+
const_reverse_iterator rend() const noexcept { return reverse_iterator(_first); }
|
182
|
+
|
179
183
|
const_reverse_iterator crend() const noexcept { return reverse_iterator(_first); }
|
180
184
|
|
181
185
|
// 23.3.11.3, capacity:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tomoto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rice
|
@@ -24,64 +24,8 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.2'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake-compiler
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: minitest
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '5'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '5'
|
83
27
|
description:
|
84
|
-
email: andrew@
|
28
|
+
email: andrew@ankane.org
|
85
29
|
executables: []
|
86
30
|
extensions:
|
87
31
|
- ext/tomoto/extconf.rb
|
@@ -90,8 +34,22 @@ files:
|
|
90
34
|
- CHANGELOG.md
|
91
35
|
- LICENSE.txt
|
92
36
|
- README.md
|
37
|
+
- ext/tomoto/ct.cpp
|
38
|
+
- ext/tomoto/dmr.cpp
|
39
|
+
- ext/tomoto/dt.cpp
|
93
40
|
- ext/tomoto/ext.cpp
|
94
41
|
- ext/tomoto/extconf.rb
|
42
|
+
- ext/tomoto/gdmr.cpp
|
43
|
+
- ext/tomoto/hdp.cpp
|
44
|
+
- ext/tomoto/hlda.cpp
|
45
|
+
- ext/tomoto/hpa.cpp
|
46
|
+
- ext/tomoto/lda.cpp
|
47
|
+
- ext/tomoto/llda.cpp
|
48
|
+
- ext/tomoto/mglda.cpp
|
49
|
+
- ext/tomoto/pa.cpp
|
50
|
+
- ext/tomoto/plda.cpp
|
51
|
+
- ext/tomoto/slda.cpp
|
52
|
+
- ext/tomoto/utils.h
|
95
53
|
- lib/tomoto.rb
|
96
54
|
- lib/tomoto/ct.rb
|
97
55
|
- lib/tomoto/dmr.rb
|
@@ -106,6 +64,8 @@ files:
|
|
106
64
|
- lib/tomoto/pa.rb
|
107
65
|
- lib/tomoto/plda.rb
|
108
66
|
- lib/tomoto/slda.rb
|
67
|
+
- lib/tomoto/tomoto.bundle
|
68
|
+
- lib/tomoto/tomoto.so
|
109
69
|
- lib/tomoto/version.rb
|
110
70
|
- vendor/EigenRand/EigenRand/Core.h
|
111
71
|
- vendor/EigenRand/EigenRand/Dists/Basic.h
|
@@ -446,6 +406,7 @@ files:
|
|
446
406
|
- vendor/tomotopy/src/Labeling/FoRelevance.cpp
|
447
407
|
- vendor/tomotopy/src/Labeling/FoRelevance.h
|
448
408
|
- vendor/tomotopy/src/Labeling/Labeler.h
|
409
|
+
- vendor/tomotopy/src/Labeling/Phraser.hpp
|
449
410
|
- vendor/tomotopy/src/TopicModel/CT.h
|
450
411
|
- vendor/tomotopy/src/TopicModel/CTModel.cpp
|
451
412
|
- vendor/tomotopy/src/TopicModel/CTModel.hpp
|
@@ -484,6 +445,9 @@ files:
|
|
484
445
|
- vendor/tomotopy/src/TopicModel/PLDA.h
|
485
446
|
- vendor/tomotopy/src/TopicModel/PLDAModel.cpp
|
486
447
|
- vendor/tomotopy/src/TopicModel/PLDAModel.hpp
|
448
|
+
- vendor/tomotopy/src/TopicModel/PT.h
|
449
|
+
- vendor/tomotopy/src/TopicModel/PTModel.cpp
|
450
|
+
- vendor/tomotopy/src/TopicModel/PTModel.hpp
|
487
451
|
- vendor/tomotopy/src/TopicModel/SLDA.h
|
488
452
|
- vendor/tomotopy/src/TopicModel/SLDAModel.cpp
|
489
453
|
- vendor/tomotopy/src/TopicModel/SLDAModel.hpp
|
@@ -542,7 +506,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
542
506
|
- !ruby/object:Gem::Version
|
543
507
|
version: '0'
|
544
508
|
requirements: []
|
545
|
-
rubygems_version: 3.
|
509
|
+
rubygems_version: 3.2.3
|
546
510
|
signing_key:
|
547
511
|
specification_version: 4
|
548
512
|
summary: High performance topic modeling for Ruby
|