Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.em
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.learn.em
Commits
3cfd9cf0
Commit
3cfd9cf0
authored
9 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Based get_config on bob.extension
parent
f53bfbbc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bob/learn/em/__init__.py
+3
-14
3 additions, 14 deletions
bob/learn/em/__init__.py
bob/learn/em/main.cpp
+5
-8
5 additions, 8 deletions
bob/learn/em/main.cpp
bob/learn/em/version.cpp
+4
-5
4 additions, 5 deletions
bob/learn/em/version.cpp
with
12 additions
and
27 deletions
bob/learn/em/__init__.py
+
3
−
14
View file @
3cfd9cf0
...
...
@@ -10,8 +10,10 @@ bob.extension.load_bob_library('bob.learn.em', __file__)
from
._library
import
*
from
.
import
version
from
.version
import
module
as
__version__
from
.version
import
api
as
__api_version__
from
.train
import
*
def
ztnorm_same_value
(
vect_a
,
vect_b
):
"""
Computes the matrix of boolean D for the ZT-norm, which indicates where
the client ids of the T-Norm models and Z-Norm samples match.
...
...
@@ -30,21 +32,8 @@ def ztnorm_same_value(vect_a, vect_b):
def
get_config
():
"""
Returns a string containing the configuration information.
"""
return
bob
.
extension
.
get_config
(
__name__
,
version
.
externals
,
version
.
api
)
import
pkg_resources
from
.version
import
externals
packages
=
pkg_resources
.
require
(
__name__
)
this
=
packages
[
0
]
deps
=
packages
[
1
:]
retval
=
"
%s: %s (%s)
\n
"
%
(
this
.
key
,
this
.
version
,
this
.
location
)
retval
+=
"
- c/c++ dependencies:
\n
"
for
k
in
sorted
(
externals
):
retval
+=
"
- %s: %s
\n
"
%
(
k
,
externals
[
k
])
retval
+=
"
- python dependencies:
\n
"
for
d
in
deps
:
retval
+=
"
- %s: %s (%s)
\n
"
%
(
d
.
key
,
d
.
version
,
d
.
location
)
return
retval
.
strip
()
# gets sphinx autodoc done right - don't remove it
__all__
=
[
_
for
_
in
dir
()
if
not
_
.
startswith
(
'
_
'
)]
This diff is collapsed.
Click to expand it.
bob/learn/em/main.cpp
+
5
−
8
View file @
3cfd9cf0
...
...
@@ -66,13 +66,12 @@ static PyObject* create_module (void) {
if
(
!
module
)
return
0
;
auto
module_
=
make_safe
(
module
);
///< protects against early returns
if
(
PyModule_AddStringConstant
(
module
,
"__version__"
,
BOB_EXT_MODULE_VERSION
)
<
0
)
return
0
;
if
(
!
init_BobLearnEMGaussian
(
module
))
return
0
;
if
(
!
init_BobLearnEMGMMStats
(
module
))
return
0
;
if
(
!
init_BobLearnEMGMMMachine
(
module
))
return
0
;
if
(
!
init_BobLearnEMKMeansMachine
(
module
))
return
0
;
if
(
!
init_BobLearnEMKMeansTrainer
(
module
))
return
0
;
if
(
!
init_BobLearnEMMLGMMTrainer
(
module
))
return
0
;
if
(
!
init_BobLearnEMMLGMMTrainer
(
module
))
return
0
;
if
(
!
init_BobLearnEMMAPGMMTrainer
(
module
))
return
0
;
if
(
!
init_BobLearnEMJFABase
(
module
))
return
0
;
...
...
@@ -85,12 +84,12 @@ static PyObject* create_module (void) {
if
(
!
init_BobLearnEMIVectorMachine
(
module
))
return
0
;
if
(
!
init_BobLearnEMIVectorTrainer
(
module
))
return
0
;
if
(
!
init_BobLearnEMPLDABase
(
module
))
return
0
;
if
(
!
init_BobLearnEMPLDAMachine
(
module
))
return
0
;
if
(
!
init_BobLearnEMPLDATrainer
(
module
))
return
0
;
if
(
!
init_BobLearnEMPLDATrainer
(
module
))
return
0
;
if
(
!
init_BobLearnEMEMPCATrainer
(
module
))
return
0
;
if
(
!
init_BobLearnEMEMPCATrainer
(
module
))
return
0
;
static
void
*
PyBobLearnEM_API
[
PyBobLearnEM_API_pointers
];
...
...
@@ -128,9 +127,7 @@ static PyObject* create_module (void) {
if
(
import_bob_io_base
()
<
0
)
return
0
;
if
(
import_bob_learn_linear
()
<
0
)
return
0
;
Py_INCREF
(
module
);
return
module
;
return
Py_BuildValue
(
"O"
,
module
);
}
PyMODINIT_FUNC
BOB_EXT_ENTRY_NAME
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
bob/learn/em/version.cpp
+
4
−
5
View file @
3cfd9cf0
...
...
@@ -17,6 +17,7 @@
#include
<bob.math/config.h>
#include
<bob.learn.activation/config.h>
#include
<bob.learn.linear/config.h>
#include
<bob.learn.em/config.h>
// TODO: add other dependencies
#include
<string>
...
...
@@ -196,8 +197,8 @@ static PyObject* create_module (void) {
auto
m_
=
make_safe
(
m
);
///< protects against early returns
/* register version numbers and constants */
if
(
PyModule_Add
String
Constant
(
m
,
"
module
"
,
BOB_
EXT_MODULE
_VERSION
)
<
0
)
return
0
;
if
(
PyModule_Add
Int
Constant
(
m
,
"
api
"
,
BOB_
LEARN_EM_API
_VERSION
)
<
0
)
return
0
;
if
(
PyModule_AddStringConstant
(
m
,
"module"
,
BOB_EXT_MODULE_VERSION
)
<
0
)
return
0
;
PyObject
*
externals
=
build_version_dictionary
();
if
(
!
externals
)
return
0
;
...
...
@@ -210,9 +211,7 @@ static PyObject* create_module (void) {
return
0
;
}
Py_INCREF
(
m
);
return
m
;
return
Py_BuildValue
(
"O"
,
m
);
}
PyMODINIT_FUNC
BOB_EXT_ENTRY_NAME
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment