Agents API¶
Visual Agent¶
Source code: sail_on_client/agent/visual_agent.py
Abstract interface for an agent that works for visual agent.
- class sail_on_client.agent.visual_agent.VisualAgent[source]¶
Abstract class for Visual Agent.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- abstract execute(toolset, step_descriptor)[source]¶
Execute method used by the protocol to run different steps associated with the algorithm.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
OND Agents¶
Source code: sail_on_client/agent/ond_agent.py
Abstract interface for an agent that works under OND.
- class sail_on_client.agent.ond_agent.ONDAgent[source]¶
Abstract class for OND agent.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- abstract execute(toolset, step_descriptor)¶
Execute method used by the protocol to run different steps associated with the algorithm.
- abstract feature_extraction(fe_toolset)¶
Abstract method for feature extraction.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
- abstract novelty_characterization(nc_toolset)[source]¶
Abstract method for novelty novelty_characterization.
Source code: sail_on_client/agent/ond_reaction_agent.py
Abstract interface for a baseline that is used to compute reaction performance.
- class sail_on_client.agent.ond_reaction_agent.ONDReactionAgent[source]¶
Abstract class for OND Reaction Agent.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- abstract execute(toolset, step_descriptor)[source]¶
Execute method used by the protocol to run different steps associated with the algorithm.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
Note
reaction agents are primarily used for baselines since they are not required to detect when the world changes
Mock OND Agents¶
Source code: sail_on_client/agent/mock_ond_agents.py
Mocks mainly used for testing protocols.
- class sail_on_client.agent.mock_ond_agents.MockONDAdapterWithCheckpoint[source]¶
Mock Adapter for testing checkpointing.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- execute(toolset, step_descriptor)[source]¶
Execute method used by the protocol to run different steps.
- feature_extraction(toolset)¶
Feature extraction step for the algorithm.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- initialize(toolset)¶
Algorithm Initialization.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
- novelty_adaptation(toolset)¶
Update models based on novelty classification and characterization.
- novelty_characterization(toolset)¶
Characterize novelty by clustering different novel samples.
- novelty_classification(toolset)¶
Classify data provided in known classes and unknown class.
- restore_attributes(step_descriptor)¶
Restore attribute for a detector.
- save_attributes(step_descriptor)¶
Save attribute for a detector.
- Returns
None
- class sail_on_client.agent.mock_ond_agents.MockONDAgent[source]¶
Mock Detector for OND Protocol.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- execute(toolset, step_descriptor)[source]¶
Execute method used by the protocol to run different steps.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
- novelty_adaptation(toolset)[source]¶
Update models based on novelty classification and characterization.
- novelty_characterization(toolset)[source]¶
Characterize novelty by clustering different novel samples.
- class sail_on_client.agent.mock_ond_agents.MockONDAgentWithAttributes[source]¶
Mock Detector for testing checkpointing.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- execute(toolset, step_descriptor)¶
Execute method used by the protocol to run different steps.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- initialize(toolset)¶
Algorithm Initialization.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
- novelty_adaptation(toolset)¶
Update models based on novelty classification and characterization.
- novelty_characterization(toolset)¶
Characterize novelty by clustering different novel samples.
- novelty_classification(toolset)¶
Classify data provided in known classes and unknown class.
Pre Computed Agents¶
Source code: sail_on_client/agent/pre_computed_detector.py
Agents that use precomputed values in the protocol.
- class sail_on_client.agent.pre_computed_detector.PreComputedAgent[source]¶
Detector for submitting precomputed results.
- __init__(algorithm_name, cache_dir, has_roundwise_file, round_size)[source]¶
Construct agent with precomputed results.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- execute(toolset, step_descriptor)[source]¶
Execute method used by the protocol to run different steps associated with the algorithm.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
- class sail_on_client.agent.pre_computed_detector.PreComputedCONDDAAgent[source]¶
Detector for submitting precomputed results in CONDDA.
- __init__(algorithm_name, cache_dir, has_roundwise_file, round_size)[source]¶
Construct agent with precomputed results for CONDDA.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- execute(toolset, step_descriptor)¶
Execute method used by the protocol to run different steps associated with the algorithm.
- feature_extraction(toolset)¶
Feature extraction step for the algorithm.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- initialize(toolset)¶
Algorithm Initialization.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
- class sail_on_client.agent.pre_computed_detector.PreComputedONDAgent[source]¶
Detector for submitting precomputed results in OND.
- __init__(algorithm_name, cache_dir, has_roundwise_file, round_size)[source]¶
Construct agent with precomputed results for OND.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- execute(toolset, step_descriptor)¶
Execute method used by the protocol to run different steps associated with the algorithm.
- feature_extraction(toolset)¶
Feature extraction step for the algorithm.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- initialize(toolset)¶
Algorithm Initialization.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
- novelty_adaptation(toolset)[source]¶
Update models based on novelty classification and characterization.
- novelty_characterization(toolset)[source]¶
Characterize novelty by clustering different novel samples.
Source code: sail_on_client/agent/pre_computed_reaction_agent.py
Reaction agent that use precomputed values in the OND protocol.
- class sail_on_client.agent.pre_computed_reaction_agent.PreComputedONDReactionAgent[source]¶
Detector for submitting precomputed results for computing reaction performance.
- __init__(algorithm_name, cache_dir, has_roundwise_file, round_size)[source]¶
Construct agent with precomputed results.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- execute(toolset, step_descriptor)[source]¶
Execute method used by the protocol to run different steps associated with the algorithm.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
CONDDA Agents¶
Source code: sail_on_client/agent/condda_agent.py
Abstract interface for an agent that works under CONDDA.
- class sail_on_client.agent.condda_agent.CONDDAAgent[source]¶
Abstract class for OND agent.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- abstract execute(toolset, step_descriptor)¶
Execute method used by the protocol to run different steps associated with the algorithm.
- abstract feature_extraction(fe_toolset)¶
Abstract method for feature extraction.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
Mock CONDDA Agents¶
Source code: sail_on_client/agent/mock_condda_agents.py
Mocks mainly used for testing CONDDA.
- class sail_on_client.agent.mock_condda_agents.MockCONDDAAdapterWithCheckpoint[source]¶
Mock Adapter for testing checkpointing.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- execute(toolset, step_descriptor)[source]¶
Execute method used by the protocol to run different steps.
- feature_extraction(toolset)¶
Feature extraction step for the algorithm.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- initialize(toolset)¶
Algorithm Initialization.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
- novelty_characterization(toolset)¶
Characterize novelty by clustering different novel samples.
- restore_attributes(step_descriptor)¶
Restore attribute for a detector.
- save_attributes(step_descriptor)¶
Save attribute for a detector.
- Returns
None
- class sail_on_client.agent.mock_condda_agents.MockCONDDAAgent[source]¶
Mock Detector for CONDDA Protocol.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- execute(toolset, step_descriptor)[source]¶
Execute method used by the protocol to run different steps.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
- class sail_on_client.agent.mock_condda_agents.MockCONDDAAgentWithAttributes[source]¶
Mock Detector for testing checkpointing.
- static __new__(cls, *args, **kwargs)¶
- Return type
~P
- Parameters
cls (Type[smqtk_core.plugin.P]) –
args (Any) –
kwargs (Any) –
- execute(toolset, step_descriptor)¶
Execute method used by the protocol to run different steps.
- classmethod from_config(config_dict, merge_default=True)¶
Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
This base method is adequate without modification when a class’s constructor argument types are JSON-compliant. If one or more are not, however, this method then needs to be overridden in order to convert from a JSON-compliant stand-in into the more complex object the constructor requires. It is recommended that when complex types are used they also inherit from the
Configurable
in order to hopefully make easier the conversion to and from JSON-compliant stand-ins.When this method does need to be overridden, this usually looks like the following pattern:
D = TypeVar("D", bound="MyClass") class MyClass (Configurable): @classmethod def from_config( cls: Type[D], config_dict: Dict, merge_default: bool = True ) -> D: # Perform a shallow copy of the input ``config_dict`` which # is important to maintain idempotency. config_dict = dict(config_dict) # Optionally guarantee default values are present in the # configuration dictionary. This is useful when the # configuration dictionary input is partial and the logic # contained here wants to use config parameters that may # have defaults defined in the constructor. if merge_default: config_dict = merge_dict(cls.get_default_config(), config_dict) # # Perform any overriding of `config_dict` values here. # # Create and return an instance using the super method. return super().from_config(config_dict, merge_default=merge_default)
Note on type annotations: When defining a sub-class of configurable and override this class method, we will need to defined a new TypeVar that is bound at the new class type. This is because super requires a type to be given that descends from the implementing type. If C is used as defined in this interface module, which is upper-bounded on the base
Configurable
class, the type analysis will see that we are attempting to invoke super with a type that may not strictly descend from the implementing type (MyClass
in the example above), and cause an error during type analysis.
- classmethod get_default_config()¶
Generate and return a default configuration dictionary for this class. This will be primarily used for generating what the configuration dictionary would look like for this class without instantiating it.
By default, we observe what this class’s constructor takes as arguments, turning those argument names into configuration dictionary keys. If any of those arguments have defaults, we will add those values into the configuration dictionary appropriately. The dictionary returned should only contain JSON compliant value types.
It is not be guaranteed that the configuration dictionary returned from this method is valid for construction of an instance of this class.
- Returns
Default configuration dictionary for the class.
- Return type
>>> # noinspection PyUnresolvedReferences >>> class SimpleConfig(Configurable): ... def __init__(self, a=1, b='foo'): ... self.a = a ... self.b = b ... def get_config(self): ... return {'a': self.a, 'b': self.b} >>> self = SimpleConfig() >>> config = self.get_default_config() >>> assert config == {'a': 1, 'b': 'foo'}
- classmethod get_impls()¶
Discover and return a set of classes that implement the calling class.
See the various
discover_via_*()
functions in this module for more details on the logic of how implementing classes (aka “plugins”) are discovered.The class-level variables
PLUGIN_ENV_VAR
andPLUGIN_NAMESPACE
may be overridden to change what environment and entry-point extension are looked for, respectively.
- initialize(toolset)¶
Algorithm Initialization.
- classmethod is_usable()¶
Determine if this class with be detected by SMQTK’s plugin.
- Return type
- novelty_characterization(toolset)¶
Characterize novelty by clustering different novel samples.