Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.mlp
Commits
fbc43ac7
Commit
fbc43ac7
authored
Feb 27, 2015
by
Ivana CHINGOVSKA
Browse files
Merge branch 'master' of github.com:bioidiap/bob.learn.mlp
parents
f12e3cf2
4b9b616e
Changes
5
Hide whitespace changes
Inline
Side-by-side
.travis.yml
View file @
fbc43ac7
...
...
@@ -20,14 +20,16 @@ before_install:
-
if [ -n "${NUMPYSPEC}" ]; then sudo apt-get install -qq gfortran; fi
-
if [ -n "${NUMPYSPEC}" ]; then pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel numpy$NUMPYSPEC; fi
-
pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel sphinx nose==1.3.0 jinja2==2.6 cpp-coveralls pygments==1.6
-
pip install coveralls
install
:
-
python bootstrap-buildout.py
-
CFLAGS=-coverage ./bin/buildout
-
C
PP
FLAGS=-
-coverage LDFLAGS=--
coverage ./bin/buildout
script
:
-
./bin/python -c 'from bob.learn.mlp import get_config; print(get_config())'
-
./bin/coverage run --source=bob.learn.mlp ./bin/nosetests -sv
-
./bin/sphinx-build -b doctest doc sphinx
-
./bin/sphinx-build -b html doc sphinx
after_success
:
-
coveralls --build-root=`pwd` --exclude=src --exclude-pattern=".*Compiler.*"
-
cpp-coveralls --build-root=`pwd` --exclude=src --exclude-pattern=".*Compiler.*" --dump=cpp_cov.json
-
coveralls --merge=cpp_cov.json
-
./src/bob.extension/scripts/upload-sphinx.sh
bob/learn/mlp/cost.cpp
View file @
fbc43ac7
...
...
@@ -10,6 +10,7 @@
#define BOB_LEARN_MLP_MODULE
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.extension/defines.h>
#include <bob.learn.mlp/api.h>
#include <bob.learn.activation/api.h>
#include <structmember.h>
...
...
@@ -297,7 +298,7 @@ static PyObject* PyBobLearnCost_f
arg
=
PyList_GET_ITEM
(
tmp
,
0
);
}
if
(
Py
Array_IsAnyScalar
(
arg
))
if
(
Py
Bob_NumberCheck
(
arg
))
return
apply_scalar
(
self
,
s_f_str
,
boost
::
bind
(
&
bob
::
learn
::
mlp
::
Cost
::
f
,
self
->
cxx
,
_1
,
_2
),
args
,
kwds
);
...
...
@@ -346,7 +347,7 @@ static PyObject* PyBobLearnCost_f_prime
arg
=
PyList_GET_ITEM
(
tmp
,
0
);
}
if
(
Py
Array_IsAnyScalar
(
arg
))
if
(
Py
Bob_NumberCheck
(
arg
))
return
apply_scalar
(
self
,
s_f_prime_str
,
boost
::
bind
(
&
bob
::
learn
::
mlp
::
Cost
::
f_prime
,
self
->
cxx
,
_1
,
_2
),
args
,
kwds
);
...
...
@@ -409,7 +410,7 @@ static PyObject* PyBobLearnCost_error
arg
=
PyList_GET_ITEM
(
tmp
,
0
);
}
if
(
Py
Array_IsAnyScalar
(
arg
))
if
(
Py
Bob_NumberCheck
(
arg
))
return
apply_scalar
(
self
,
s_error_str
,
boost
::
bind
(
&
bob
::
learn
::
mlp
::
Cost
::
error
,
self
->
cxx
,
_1
,
_2
),
args
,
kwds
);
...
...
bob/learn/mlp/machine.cpp
View file @
fbc43ac7
...
...
@@ -10,6 +10,7 @@
#define BOB_LEARN_MLP_MODULE
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.extension/defines.h>
#include <bob.io.base/api.h>
#include <bob.learn.activation/api.h>
#include <bob.learn.mlp/api.h>
...
...
@@ -275,7 +276,7 @@ static PyObject* PyBobLearnMLPMachine_getWeights
static
int
PyBobLearnMLPMachine_setWeights
(
PyBobLearnMLPMachineObject
*
self
,
PyObject
*
weights
,
void
*
/*closure*/
)
{
if
(
Py
Array_IsAnyScalar
(
weights
)){
if
(
Py
Bob_NumberCheck
(
weights
)){
double
v
=
PyFloat_AsDouble
(
weights
);
if
(
PyErr_Occurred
())
return
-
1
;
self
->
cxx
->
setWeights
(
v
);
...
...
@@ -361,7 +362,7 @@ static PyObject* PyBobLearnMLPMachine_getBiases
static
int
PyBobLearnMLPMachine_setBiases
(
PyBobLearnMLPMachineObject
*
self
,
PyObject
*
biases
,
void
*
/*closure*/
)
{
if
(
Py
Array_IsAnyScalar
(
biases
)){
if
(
Py
Bob_NumberCheck
(
biases
)){
double
v
=
PyFloat_AsDouble
(
biases
);
if
(
PyErr_Occurred
())
return
-
1
;
self
->
cxx
->
setBiases
(
v
);
...
...
@@ -435,7 +436,7 @@ static PyObject* PyBobLearnMLPMachine_getInputSubtraction
static
int
PyBobLearnMLPMachine_setInputSubtraction
(
PyBobLearnMLPMachineObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
Py
Array_IsAnyScalar
(
o
)){
if
(
Py
Bob_NumberCheck
(
o
)){
double
v
=
PyFloat_AsDouble
(
o
);
if
(
PyErr_Occurred
())
return
-
1
;
self
->
cxx
->
setInputSubtraction
(
v
);
...
...
@@ -482,7 +483,7 @@ static PyObject* PyBobLearnMLPMachine_getInputDivision
static
int
PyBobLearnMLPMachine_setInputDivision
(
PyBobLearnMLPMachineObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
Py
Array_IsAnyScalar
(
o
))
{
if
(
Py
Bob_NumberCheck
(
o
))
{
double
v
=
PyFloat_AsDouble
(
o
);
if
(
PyErr_Occurred
())
return
-
1
;
self
->
cxx
->
setInputDivision
(
v
);
...
...
requirements.txt
View file @
fbc43ac7
setuptools
bob.extension
bob.extension
>2.0.4
bob.blitz
bob.io.base
bob.math
...
...
version.txt
View file @
fbc43ac7
2.0.2b0
\ No newline at end of file
2.0.3b0
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment