Skip to content

Commit 6c6110d

Browse files
committed
remove libraries
1 parent 1b2be63 commit 6c6110d

11 files changed

+174
-200
lines changed

embml/sklearnModels/embml_sklearn_DecisionTreeClassifier.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ def write_output_rules(classifier, opts):
124124
utils.write_define("INPUT_SIZE", str(classifier.inputSize))
125125

126126
# Include of libraries
127-
incls += utils.write_include("<Arduino.h>")
128127
if opts['useFxp']:
129128
incls += utils.write_define("TOTAL_BITS", str(opts['totalBits'])) + \
130129
utils.write_define("FIXED_FBITS", str(opts['fracBits'])) + \

embml/sklearnModels/embml_sklearn_LinearSVC.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def write_output(classifier, opts):
6262
utils.write_define("INPUT_SIZE", str(len(classifier.coef[0])))
6363

6464
# Include of libraries
65-
incls += utils.write_include("<Arduino.h>")
6665
if opts['useFxp']:
6766
incls += utils.write_define("TOTAL_BITS", str(opts['totalBits'])) + \
6867
utils.write_define("FIXED_FBITS", str(opts['fracBits'])) + \

embml/sklearnModels/embml_sklearn_LogisticRegression.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def write_output(classifier, opts):
6262
utils.write_define("INPUT_SIZE", str(len(classifier.coef[0])))
6363

6464
# Include of libraries
65-
incls += utils.write_include("<Arduino.h>")
6665
if opts['useFxp']:
6766
incls += utils.write_define("TOTAL_BITS", str(opts['totalBits'])) + \
6867
utils.write_define("FIXED_FBITS", str(opts['fracBits'])) + \

embml/sklearnModels/embml_sklearn_MLPClassifier.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def activation_function(activation, opts):
7070
("%.10f" % opts['pwlPoints'][0])), tabs=1) + \
7171
utils.write_ret((utils.toFxp(0.0, opts) \
7272
if opts['useFxp'] else \
73-
"0.0"), tabs=2) + \
73+
"0.0f"), tabs=2) + \
7474
utils.write_end(tabs=1)
7575

7676
# Internal points
@@ -93,7 +93,7 @@ def activation_function(activation, opts):
9393
pwlCode += utils.write_else(tabs=1) + \
9494
utils.write_ret((utils.toFxp(1.0, opts) \
9595
if opts['useFxp'] else \
96-
"1.0"), tabs=2) + \
96+
"1.0f"), tabs=2) + \
9797
utils.write_end(tabs=1)
9898

9999
return pwlCode
@@ -106,18 +106,18 @@ def activation_function(activation, opts):
106106
", fxp_div(x, fxp_sum(" + \
107107
utils.toFxp(1.0, opts) + ", my_abs(x)))))") \
108108
if opts['useFxp'] else \
109-
"0.5 * (x / (1.0 + my_abs(x))) + 0.5")
109+
"0.5f * (x / (1.0f + my_abs(x))) + 0.5f")
110110
else:
111111
# Using original sigmoid function
112112
funcCode = (("fxp_div(" + utils.toFxp(1.0, opts) +\
113113
", fxp_sum(" + utils.toFxp(1.0, opts) +\
114114
", fxp_exp(-x)))")\
115115
if opts['useFxp'] else \
116-
"1.0 / (1.0 + expf(-x))")
116+
"1.0f / (1.0f + expf(-x))")
117117
elif activation == 'relu':
118118
funcCode = (("max(" + utils.toFxp(0, opts) + ", x)")\
119119
if opts['useFxp'] else \
120-
"max(0.0, x)")
120+
"max(0.0f, x)")
121121
else:
122122
print ("Activation function " + activation + " not supported!")
123123
exit(1)
@@ -277,7 +277,6 @@ def write_output(classifier, opts):
277277
utils.write_define("my_abs(x)", "(((x) > (0.0)) ? (x) : -(x))")
278278

279279
# Include of libraries
280-
incls += utils.write_include("<Arduino.h>")
281280
if opts['useFxp']:
282281
incls += utils.write_define("TOTAL_BITS", str(opts['totalBits'])) + \
283282
utils.write_define("FIXED_FBITS", str(opts['fracBits'])) + \

embml/sklearnModels/embml_sklearn_SVC_Kernel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ def write_output(classifier, opts):
260260
utils.write_define("MODEL_L", str(classifier.model_l))
261261

262262
# Include of libraries
263-
incls += utils.write_include("<Arduino.h>")
264263
if opts['useFxp']:
265264
incls += utils.write_define("TOTAL_BITS", str(opts['totalBits'])) + \
266265
utils.write_define("FIXED_FBITS", str(opts['fracBits'])) + \

embml/wekaModels/embml_weka_J48.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ def write_output_rules(weka_j48, opts):
245245
utils.write_define("INPUT_SIZE", str(len(weka_j48.attributes)))
246246

247247
# Include of libraries
248-
incls += utils.write_include("<Arduino.h>")
249248
if opts['useFxp']:
250249
incls += utils.write_define("TOTAL_BITS", str(opts['totalBits'])) + \
251250
utils.write_define("FIXED_FBITS", str(opts['fracBits'])) + \

embml/wekaModels/embml_weka_Logistic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ def write_output(classifier, opts):
150150

151151

152152
# Include of libraries
153-
incls += utils.write_include("<Arduino.h>")
154153
if opts['useFxp']:
155154
incls += utils.write_define("TOTAL_BITS", str(opts['totalBits'])) + \
156155
utils.write_define("FIXED_FBITS", str(opts['fracBits'])) + \

0 commit comments

Comments
 (0)