yadll.utils

Utils

yadll.utils.to_float_X(arr)[source]

Cast to floatX numpy array

Parameters:arr: list or numpy array
Returns:numpy array of floatX
yadll.utils.shared_variable(value, dtype='float64', name=None, borrow=True, **kwargs)[source]

Create a Theano Shared Variable

Parameters:

value:

value of the shared variable

dtype : default floatX

type of the shared variable

name : string, optional

shared variable name

borrow : bool, default is True

if True shared variable we construct does not get a [deep] copy of value. So changes we subsequently make to value will also change our shared variable.

Returns:

Theano Shared Variable

yadll.utils.format_sec(sec)[source]

format a time

Parameters:

sec : float

time in seconds

Returns:

string :

formatted time in days, hours, minutes and seconds

yadll.utils.timer(what_to_show='Function execution')[source]

decorator that send the execution time of the argument function to the logger

Parameters:

what_to_show : string, optional

message displayed after execution