for num in range(10):
NumberStats.getInstance().add(num)-num)
NumberStats.getInstance().add(
NumberStats.getInstance().report()
--- stats report
Max: 9.000
Min: -9.000
SingletonObjects ()
A utility for refrencing objects that should only be declared once.
UniqueNamer ()
A utility for ensuring the names of functions are unique.
FunctionsList ()
A utility for storing functions created, keyed on the function name.
Memory ()
A utility for recording global values.
NumberStats ()
A utility for calculating the statistice of a number.
for num in range(10):
NumberStats.getInstance().add(num)
NumberStats.getInstance().add(-num)
NumberStats.getInstance().report()
--- stats report
Max: 9.000
Min: -9.000
dynamic_module_import (modulename, package=None)
dynamic_class_load (modulename, classname)
get_drive ()
loadjson (file)
{'type': 'WeightedSum', 'name': 'weighted_sum', 'value': 35, 'links': {'0': 'constant', '1': 'constant1', '2': 'constant2'}, 'weights': [1, 1, 1]}
Counter (limit=1000, init=0, step=1, print=100, pause=False, display=10)
Initialize self. See help(type(self)) for accurate signature.
stringIntListToListOfInts (strList, delimiter)
stringFloatListToListOfFloats (strList, delimiter)
stringListToListOfStrings (strList, delimiter=',')
listNumsToString (list)
round_lists (alist, formatted, places)
floatListsToString (alist, places)
limit_large_float (val, limit=10000000)
sigmoid (x, range, slope)
smooth (new_val, old_val, smooth_factor)
sigmoid_array (x, range, slope)
dot (inputs, weights)
list_of_ones (num)
limit_to_range (num, lower, upper)
wrap_env (env)
show_video ()
x = 2 #np.linspace(-5, 5, 11)
#x = -10000001
range=2
scale=2
y = sigmoid(x, range, scale)
print(y)
# plt.plot(x, y)
# plt.grid()
# plt.xlim(-6, 6)
# plt.xlabel('x')
# plt.title('expit(x)')
# plt.show()
0.7615941559557646
is_in_notebooks ()
printtime (msg)
clip_value (val, range)
map_to_int_even_range (val=None, inrange=None, outrange=None)
map_to_int_odd_range (val=None, inrange=None, outrange=None)
limits = [-2, 2]
mapped = [1, 5]
vals = [-3.1, -2.1, -1.51, -1.5, -1.4, -0.9,-0.5, -0.1, 0, 0.1, 0.6, 1.1, 2.1, 210.1 ]
for val in vals:
print(val, map_to_int_odd_range(val, limits, mapped))
-3.1 1
-2.1 1
-1.51 1
-1.5 1
-1.4 2
-0.9 2
-0.5 3
-0.1 3
0 3
0.1 3
0.6 4
1.1 4
2.1 5
210.1 5
#vals = [0.6]
vals = [-3.1, -2.1, -1.51, -1.5, -1.4, -0.9, -0.5, -0.1, 0, 0.1, 0.6, 1.1, 2.1, 210.1 ]
limits = [-2, 2]
mapped = [1, 4]
for val in vals:
print(val, map_to_int_even_range(val, limits, mapped))
-3.1 1
-2.1 1
-1.51 1
-1.5 1
-1.4 1
-0.9 2
-0.5 2
-0.1 2
0 3
0.1 3
0.6 3
1.1 4
2.1 4
210.1 4
Timer ()
Initialize self. See help(type(self)) for accurate signature.
A custom exception used to report errors in use of Timer class