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

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
agrimagsrl committed Dec 22, 2019
1 parent 915f055 commit 0bb6d6a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
Binary file removed dist/micromlgen-0.6.tar.gz
Binary file not shown.
Binary file added dist/micromlgen-0.7.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion micromlgen/templates/compute_kernels.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if platform == 'attiny' %}
{% if isAttiny %}
float w[{{ FEATURES_DIM }}];
{% endif %}

Expand Down
6 changes: 3 additions & 3 deletions micromlgen/templates/kernel_function.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Kernel type: {{ KERNEL_TYPE }}
*/
{% if isAttiny %}
double compute_kernel(double x[{{ FEATURES_DIM }}], double w[{{ FEATURES_DIM }}]) {
double compute_kernel(double x[{{ FEATURES_DIM }}], float w[{{ FEATURES_DIM }}]) {
double kernel = 0.0;
{% else %}
double compute_kernel(double x[{{ FEATURES_DIM }}], ...) {
Expand All @@ -15,9 +15,9 @@ double compute_kernel(double x[{{ FEATURES_DIM }}], ...) {

for (uint16_t i = 0; i < {{ FEATURES_DIM }}; i++)
{% if KERNEL_TYPE in ['linear', 'poly', 'sigmoid'] %}
kernel += x[i] * {% if isAttiny %} w[i] {% else %} va_arg(w, double), 2) {% endif %};
kernel += x[i] * {% if isAttiny %} w[i] {% else %} va_arg(w, double) {% endif %};
{% elif KERNEL_TYPE == 'rbf' %}
kernel += pow(x[i] - {% if isAttiny %} w[i] {% else %} va_arg(w, double), 2) {% endif %};
kernel += pow(x[i] - {% if isAttiny %} w[i] {% else %} va_arg(w, double) {% endif %}, 2);
{% else %}
#error "UNKNOWN KERNEL {{ kernel }}";
{% endif %}
Expand Down
2 changes: 2 additions & 0 deletions publish
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# user agrimag

#git push origin master -f
rm -rf dist/*
python setup.py sdist
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
setup(
name = 'micromlgen',
packages = ['micromlgen'],
version = '0.6',
version = '0.7',
license='MIT',
description = 'Generate C code for microcontrollers from Python\'s sklearn classifiers',
author = 'Simone Salerno',
author_email = '[email protected]',
url = 'https://github.com/agrimagsrl/micromlgen',
download_url = 'https://github.com/agrimagsrl/micromlgen/archive/v_06.tar.gz',
download_url = 'https://github.com/agrimagsrl/micromlgen/archive/v_07.tar.gz',
keywords = ['ML', 'microcontrollers', 'sklearn', 'machine learning'],
install_requires=[
'jinja2',
Expand Down

0 comments on commit 0bb6d6a

Please sign in to comment.