Commit 11d18a5a authored by André Anjos's avatar André Anjos 💬

Implement test unit showing the problem (see #9)

parent c7ac597f
Pipeline #8432 failed with stages
in 8 minutes and 51 seconds
......@@ -214,4 +214,21 @@ def test_training_one_class():
curr_scores = numpy.array(curr_scores)
prev_scores = numpy.array(prev_scores)
assert numpy.all(abs(curr_scores - prev_scores) < 1e-8)
def test_successive_training():
# Tests successive training works: i.e., training a couple of machines one
# after the other.
numpy.random.seed(10)
for i in range(2):
pos = numpy.random.normal(0., 1, size=(100, 2))
neg = numpy.random.normal(1., 1, size=(100, 2))
data = [pos, neg]
trainer = Trainer()
trainer.kernel_type = 'LINEAR'
trainer.cost = 1
trainer.train(data)
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