Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
9f50ab67
Commit
9f50ab67
authored
Jul 02, 2013
by
Davis King
Browse files
Added more stuff to example
parent
e1307b31
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
python_examples/svm_struct.py
python_examples/svm_struct.py
+8
-0
No files found.
python_examples/svm_struct.py
View file @
9f50ab67
...
@@ -84,3 +84,11 @@ problem = three_class_classifier_problem(samples, labels)
...
@@ -84,3 +84,11 @@ problem = three_class_classifier_problem(samples, labels)
weights
=
dlib
.
solve_structural_svm_problem
(
problem
)
weights
=
dlib
.
solve_structural_svm_problem
(
problem
)
print
weights
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
])
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