mlpy.modules.UniqueModule

class mlpy.modules.UniqueModule(mid=None)[source]

Bases: object

Class ensuring each instance has a unique name.

The unique id can either be passed to the class or if none is passed, it will be generated using the module and class name.

Parameters:

mid : str

The module’s unique identifier

Examples

>>> from mlpy.modules import UniqueModule
>>> class MyClass(UniqueModule):
>>>
>>>     def __init__(self, mid=None):
>>>         super(MyClass, self).__init__(mid)

This creates a unique model.

Attributes

mid The module’s unique identifier.

Methods

load(filename) Load the state of the module from file.
save(filename) Save the current state of the module to file.