From 9f50ab67fbb4a537bcfd361d4fce0235dba03106 Mon Sep 17 00:00:00 2001 From: Davis King Date: Tue, 2 Jul 2013 22:53:07 -0400 Subject: [PATCH] Added more stuff to example --- python_examples/svm_struct.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python_examples/svm_struct.py b/python_examples/svm_struct.py index 83134210e..df1825d81 100755 --- a/python_examples/svm_struct.py +++ b/python_examples/svm_struct.py @@ -84,3 +84,11 @@ problem = three_class_classifier_problem(samples, labels) weights = dlib.solve_structural_svm_problem(problem) print weights +w1 = weights[0:3] +w2 = weights[3:6] +w3 = weights[6:9] + +print "scores for class 1 sample: ", dot(w1, samples[0]), dot(w2,samples[0]), dot(w3, samples[0]) +print "scores for class 2 sample: ", dot(w1, samples[1]), dot(w2,samples[1]), dot(w3, samples[1]) +print "scores for class 3 sample: ", dot(w1, samples[2]), dot(w2,samples[2]), dot(w3, samples[2]) +