Commit fbc43ac7 authored by Ivana CHINGOVSKA's avatar Ivana CHINGOVSKA
Browse files

Merge branch 'master' of github.com:bioidiap/bob.learn.mlp

parents f12e3cf2 4b9b616e
......@@ -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
- CPPFLAGS=--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
......@@ -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 (PyArray_IsAnyScalar(arg))
if (PyBob_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 (PyArray_IsAnyScalar(arg))
if (PyBob_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 (PyArray_IsAnyScalar(arg))
if (PyBob_NumberCheck(arg))
return apply_scalar(self, s_error_str,
boost::bind(&bob::learn::mlp::Cost::error, self->cxx, _1, _2), args, kwds);
......
......@@ -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 (PyArray_IsAnyScalar(weights)){
if (PyBob_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 (PyArray_IsAnyScalar(biases)){
if (PyBob_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 (PyArray_IsAnyScalar(o)){
if (PyBob_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 (PyArray_IsAnyScalar(o)) {
if (PyBob_NumberCheck(o)) {
double v = PyFloat_AsDouble(o);
if (PyErr_Occurred()) return -1;
self->cxx->setInputDivision(v);
......
2.0.2b0
\ No newline at end of file
2.0.3b0
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment