Commit 7df8e993 authored by Manuel Günther's avatar Manuel Günther

Continued switching to bob::extension documentation

parent defd4d91
......@@ -35,11 +35,6 @@ namespace bob { namespace learn { namespace linear {
return !(this->operator==(other));
}
bool WCCNTrainer::is_similar_to (const WCCNTrainer& other,
const double r_epsilon, const double a_epsilon) const {
return true;
}
void WCCNTrainer::train(Machine& machine,
const std::vector<blitz::Array<double, 2> >& data) const {
......
......@@ -61,11 +61,6 @@ namespace bob { namespace learn { namespace linear {
* @brief Not equal to
*/
bool operator!=(const WCCNTrainer& other) const;
/**
* @brief Similar to
*/
bool is_similar_to(const WCCNTrainer& other, const double r_epsilon=1e-5,
const double a_epsilon=1e-8) const;
/**
* @brief Trains the LinearMachine to perform the WCCN
......
This diff is collapsed.
......@@ -39,19 +39,15 @@ static PyModuleDef module_definition = {
extern bool init_BobLearnLinearMachine(PyObject* module);
extern bool init_BobLearnLinearPCA(PyObject* module);
extern bool init_BobLearnLinearLDA(PyObject* module);
extern bool init_BobLearnLinearCGLogReg(PyObject* module);
extern bool init_BobLearnLinearWCCN(PyObject* module);
extern bool init_BobLearnLinearBIC(PyObject* module);
static PyObject* create_module (void) {
PyBobLearnLinearCGLogRegTrainer_Type.tp_new = PyType_GenericNew;
if (PyType_Ready(&PyBobLearnLinearCGLogRegTrainer_Type) < 0) return 0;
PyBobLearnLinearWhiteningTrainer_Type.tp_new = PyType_GenericNew;
if (PyType_Ready(&PyBobLearnLinearWhiteningTrainer_Type) < 0) return 0;
PyBobLearnLinearWCCNTrainer_Type.tp_new = PyType_GenericNew;
if (PyType_Ready(&PyBobLearnLinearWCCNTrainer_Type) < 0) return 0;
# if PY_VERSION_HEX >= 0x03000000
PyObject* m = PyModule_Create(&module_definition);
# else
......@@ -61,20 +57,15 @@ static PyObject* create_module (void) {
auto m_ = make_safe(m);
/* register the types to python */
Py_INCREF(&PyBobLearnLinearCGLogRegTrainer_Type);
if (PyModule_AddObject(m, "CGLogRegTrainer", (PyObject *)&PyBobLearnLinearCGLogRegTrainer_Type) < 0) return 0;
Py_INCREF(&PyBobLearnLinearWhiteningTrainer_Type);
if (PyModule_AddObject(m, "WhiteningTrainer", (PyObject *)&PyBobLearnLinearWhiteningTrainer_Type) < 0) return 0;
Py_INCREF(&PyBobLearnLinearWCCNTrainer_Type);
if (PyModule_AddObject(m, "WCCNTrainer", (PyObject *)&PyBobLearnLinearWCCNTrainer_Type) < 0) return 0;
if (!init_BobLearnLinearMachine(m)) return 0;
if (!init_BobLearnLinearPCA(m)) return 0;
if (!init_BobLearnLinearLDA(m)) return 0;
if (!init_BobLearnLinearCGLogReg(m)) return 0;
if (!init_BobLearnLinearWCCN(m)) return 0;
if (!init_BobLearnLinearBIC(m)) return 0;
static void* PyBobLearnLinear_API[PyBobLearnLinear_API_pointers];
/* exhaustive list of C APIs */
......
......@@ -657,11 +657,10 @@ def test_wccn_initialization():
t3 = WCCNTrainer(t2)
t4 = t3
assert t1 == t2
assert t1.is_similar_to(t2)
assert t1 == t3
assert t1.is_similar_to(t3)
assert t1 == t4
assert t1.is_similar_to(t4)
assert t2 is not t3
assert t3 is t4
def test_wccn_train():
......
This diff is collapsed.
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