training_ml_control.nb_utils#

Module Contents#

Classes#

TflWorkshopMagic

Functions#

set_random_seed

Sets random seed (as name suggests…).

display_array

Displays numpy arrays as latex bmatrix.

show_video

Renders the given frames as a video.

Data#

__all__

API#

training_ml_control.nb_utils.__all__#

[‘set_random_seed’, ‘TflWorkshopMagic’, ‘display_array’, ‘show_video’]

training_ml_control.nb_utils.set_random_seed(seed: int = 16) None[source]#

Sets random seed (as name suggests…).

class training_ml_control.nb_utils.TflWorkshopMagic(shell)[source]#

Bases: IPython.core.magic.Magics

set_random_seed(seed: str)[source]#
view_hint(path: os.PathLike)[source]#
presentation_style(style_file: str)[source]#

Apply the styles to the notebook (outside presentation mode). NOTE: Has to be the last command in a cell.

:param style_file: Relative path to the CSS file containing the style that will be applied to the notebook cells. Defaults to rise.css

training_ml_control.nb_utils.display_array(name: str, array: numpy.typing.NDArray) None[source]#

Displays numpy arrays as latex bmatrix.

training_ml_control.nb_utils.show_video(frames: list[numpy.typing.NDArray], fps: float, *, title: str | None = None, codec: str = 'gif', **kwargs: Any) None[source]#

Renders the given frames as a video.

If no frames are passed, then it simply returns without doing anything.