soft.computing.blueprints package

Submodules

soft.computing.blueprints.computer_vision module

This module contains a blueprint for creating a knowledge base for computer vision applications.

soft.computing.blueprints.computer_vision.vision_knowledge_base(observation_shape) KnowledgeBase

Create a knowledge base for computer vision applications.

soft.computing.blueprints.factory module

This script implements code functionality that is common between SelfOrganize processes and blueprints. More specifically, it provides a convenient factory interface to building SelfOrganize objects, where shorthand algorithm names can be used, and their necessary edges are then created.

class soft.computing.blueprints.factory.AlgorithmFamily

Bases: dict

A special class to organize algorithms that belong to a family of purpose (e.g., finding fuzzy logic rules). Helps facilitate class method registration inside SystematicDesignProcess.

register(method: callable)

Register the given class method with an AlgorithmFamily instance.

Parameters:

method – The class method to register.

Returns:

The class method.

class soft.computing.blueprints.factory.SystematicDesignProcess(algorithms: List[str], config: Config)

Bases: object

A factory to assist in conveniently building SelfOrganize objects. This class is not necessary to using SelfOrganize, but rather, it helps alleviate some of the repetitive code that arises from the class. In particular, oftentimes the calls to Categorical Learning Induced Partitioning, and its related edges, are common between many SelfOrganize “blueprints”.

auto_encoder_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to use an auto-encoder.

Returns:

A list of edges, represented as 3-tuples.

build(training_data: SupervisedDataset, validation_data: SupervisedDataset | None = None) SelfOrganize

Build a SelfOrganize object from the provided arguments.

Parameters:
  • training_data – The training data.

  • validation_data – The validation data (optional - not all processes expect it).

Returns:

A self-organizing knowledge base that is capable of constructing another knowledge base.

clip_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to use CLIP.

Returns:

A list of edges, represented as 3-tuples.

create_knowledge_base = {'ftarm_edges': <function SystematicDesignProcess.ftarm_edges>, 'make_knowledge_base_edges': <function SystematicDesignProcess.make_knowledge_base_edges>}
ecm_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to use ECM.

Returns:

A list of edges, represented as 3-tuples.

static exemplars(exemplars: LabeledClusters) LabeledClusters

This static method serves as a common gate where each method involving the generation or use of exemplars can easily reference them. Essentially, it is an algorithm independent way of fetching this type of information.

Parameters:

exemplars – The exemplars, or note-worthy moments in the dataset.

Returns:

The exemplars, or note-worthy moments in the dataset.

expert_partition_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to use Expert Partitioning.

Returns:

A list of edges, represented as 3-tuples.

find_exemplars = {'auto_encoder_edges': <function SystematicDesignProcess.auto_encoder_edges>, 'ecm_edges': <function SystematicDesignProcess.ecm_edges>, 'gmeans_edges': <function SystematicDesignProcess.gmeans_edges>, 'hdbscan_edges': <function SystematicDesignProcess.hdbscan_edges>, 'persistable_edges': <function SystematicDesignProcess.persistable_edges>, 'ttsas_edges': <function SystematicDesignProcess.ttsas_edges>}
find_fuzzy_logic_rules = {'latent_lockstep_edges': <function SystematicDesignProcess.latent_lockstep_edges>, 'no_rules_edges': <function SystematicDesignProcess.no_rules_edges>, 'wang_mendel_edges': <function SystematicDesignProcess.wang_mendel_edges>}
find_membership_functions = {'clip_edges': <function SystematicDesignProcess.clip_edges>, 'expert_partition_edges': <function SystematicDesignProcess.expert_partition_edges>}
ftarm_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to make a KnowledgeBase using FTARM.

Returns:

A list of edges, represented as 3-tuples.

get_functions() Set[callable]

Get the functions that are involved in this systematic design process.

This method is required as the graph expects the vertices to first exist before edges can be connected between them.

Returns:

A set of functions.

Get the links/edges that are necessary to facilitate the flow of operations between the involved functions of this systematic design process.

Returns:

A list of edges, where each edge is in the form of (source, target, target argument index).

gmeans_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to use GMeans.

Returns:

A list of edges, represented as 3-tuples.

hdbscan_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to use HDBSCAN.

Returns:

A list of edges, represented as 3-tuples.

static knowledge_base(knowledge_base: KnowledgeBase) KnowledgeBase

This static method serves as a common gate where each method involving the creation or use of the knowledge base can easily reference it. Essentially, it is an algorithm independent way of fetching this type of information.

This is often expected to be used before a KnowledgeBase object is constructed.

Parameters:

knowledge_base – The knowledge base.

Returns:

The knowledge base.

latent_lockstep_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to use Latent-Lockstep Method.

Returns:

A list of edges, represented as 3-tuples.

make_knowledge_base_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to make a KnowledgeBase.

Returns:

A list of edges, represented as 3-tuples.

no_rules_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to use no rules.

persistable_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to use Persistable.

Returns:

A list of edges, represented as 3-tuples.

reduce_fuzzy_logic_rules = {}
static reduced_rules(reduced_rules: Set[Rule]) Set[Rule]

This static method serves as a common gate where each method involving the reduction or use of fuzzy logic rules can easily reference them. Essentially, it is an algorithm independent way of fetching this type of information.

This is often expected to be used before a KnowledgeBase object is constructed.

Parameters:

reduced_rules – The reduced/simplified fuzzy logic rules.

Returns:

The reduced/simplified fuzzy logic rules.

static rules(fuzzy_logic_rules: Set[Rule]) Set[Rule]

This static method serves as a common gate where each method involving the generation or use of fuzzy logic rules can easily reference them. Essentially, it is an algorithm independent way of fetching this type of information.

Parameters:

fuzzy_logic_rules – The fuzzy logic rules.

Returns:

The fuzzy logic rules.

ttsas_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to use TTSAS.

Returns:

A list of edges, represented as 3-tuples.

wang_mendel_edges() List[Tuple[Any, callable, int]]

This function will return the edges required to use Wang-Mendel Method.

Returns:

A list of edges, represented as 3-tuples.

soft.computing.blueprints.fyd module

This script implements the necessary operations for the FYD method to self-organize neuro-fuzzy networks.

soft.computing.blueprints.fyd.clip_frequent_discernible(training_data, validation_data, config: Config) SelfOrganize

The CLIP-Frequent-Discernible approach to self-organize FLCs.

The idea behind this method is to find the antecedents that make each fuzzy logic rule discernible from one another (Rough Sets) while also taking into account their frequency, or in other words, their support across the entire data. We want antecedents in our fuzzy logic rules that discern themselves well, but are well-supported or activated by the input data.

Note: At some point during this self organization process, the code will automatically switch to a GPU if one is available, regardless of user-defined configuration settings.

Parameters:
  • training_data – The training data to use.

  • validation_data – The validation data to use.

  • config – The configuration to use.

Returns:

An object to self organize a neuro-fuzzy network according to the CLIP-FYD approach.

soft.computing.blueprints.rule_analysis module

Module contents