Skip to content
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.

Commit

Permalink
fix kernel function
Browse files Browse the repository at this point in the history
  • Loading branch information
agrimagsrl committed Dec 21, 2019
1 parent 98de2d0 commit 1dcb1ef
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
venv
.idea
tests
Binary file added micromlgen/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file added micromlgen/__pycache__/micromlgen.cpython-36.pyc
Binary file not shown.
22 changes: 0 additions & 22 deletions micromlgen/micromlgen_test.py

This file was deleted.

4 changes: 2 additions & 2 deletions micromlgen/templates/kernel_function.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ double compute_kernel(double x[{{ FEATURES_DIM }}], ...) {
{% endif %}

{% if KERNEL_TYPE == 'poly' %}
kernel = pow((KERNEL_GAMMA * kernel) + KERNEL_COEF, KERNEL_DEGREE);
kernel = pow(({{ KERNEL_GAMMA }} * kernel) + {{ KERNEL_COEF }}, {{ KERNEL_DEGREE }});
{% elif KERNEL_TYPE == 'rbf' %}
kernel = exp(-{{ KERNEL_GAMMA }} * kernel);
{% elif KERNEL_TYPE == 'sigmoid' %}
kernel = sigmoid((KERNEL_GAMMA * kernel) + KERNEL_COEF);
kernel = sigmoid(({{ KERNEL_GAMMA }} * kernel) + {{ KERNEL_COEF }});
{% endif %}

return kernel;
Expand Down

0 comments on commit 1dcb1ef

Please sign in to comment.