--- title: Utilities keywords: fastai sidebar: home_sidebar nb_path: "nbs/01_putils.ipynb" ---
{% raw %}
{% endraw %} {% raw %}
%load_ext autoreload
%autoreload 2
{% endraw %} {% raw %}
#%nbdev_default_export putils
{% endraw %} {% raw %}
{% endraw %} {% raw %}

class UniqueNamer[source]

UniqueNamer()

A utility for ensuring the names of functions are unique.

{% endraw %} {% raw %}
{% endraw %} {% raw %}

class FunctionsList[source]

FunctionsList()

A utility for storing functions created, keyed on the function name.

{% endraw %} {% raw %}
{% endraw %} {% raw %}
from pct.functions import Proportional 
prop = Proportional()
{% endraw %} {% raw %}
UniqueNamer.getInstance().report()
{% endraw %} {% raw %}
FunctionsList.getInstance().report()
{% endraw %} {% raw %}

dynamic_module_import[source]

dynamic_module_import(modulename, package=None)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

dynamic_class_load[source]

dynamic_class_load(modulename, classname)

{% endraw %} {% raw %}
{% endraw %} {% raw %}
#importlib.import_module('pct.functions', 'Constant')   
{% endraw %} {% raw %}

get_drive[source]

get_drive()

{% endraw %} {% raw %}
{% endraw %} {% raw %}

class Counter[source]

Counter(limit=1000, init=0, step=1, print=100, pause=False, display=10)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

stringIntListToListOfInts[source]

stringIntListToListOfInts(strList, delimiter)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

stringFloatListToListOfFloats[source]

stringFloatListToListOfFloats(strList, delimiter)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

stringListToListOfStrings[source]

stringListToListOfStrings(strList, delimiter=',')

{% endraw %} {% raw %}
{% endraw %} {% raw %}

listNumsToString[source]

listNumsToString(list)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

sigmoid[source]

sigmoid(x, range, scale)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

smooth[source]

smooth(new_val, old_val, smooth_factor)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

dot[source]

dot(inputs, weights)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

list_of_ones[source]

list_of_ones(num)

{% endraw %} {% raw %}
{% endraw %} {% raw %}
print(list_of_ones(3))
[1, 1, 1]
{% endraw %} {% raw %}

show_video[source]

show_video()

{% endraw %} {% raw %}

wrap_env[source]

wrap_env(env)

{% endraw %} {% raw %}
{% endraw %} {% raw %}
import matplotlib.pyplot as plt
x = np.linspace(-5, 5, 11)
range=2
scale=2
y = sigmoid(x, range, scale)
plt.plot(x, y)
plt.grid()
plt.xlim(-6, 6)
plt.xlabel('x')
plt.title('expit(x)')
plt.show()
{% endraw %} {% raw %}

is_in_notebooks[source]

is_in_notebooks()

{% endraw %} {% raw %}
{% endraw %} {% raw %}
 
{% endraw %} {% raw %}
#from nbdev import *
#notebook2script()
{% endraw %}