Flex.System (FLex v0.2.2)
View SourceAn interface to create a Fuzzy Logic Control System (FLS).
The Fuzzy controllers are very simple conceptually. They consist of an input stage (fuzzification), a processing stage (inference), and an output stage (defuzzification).
Summary
Functions
Adjust the premise free parameters of the FIS (only avaliable with ANFIS engine), using the following methods
Returns a specification to start this module under a supervisor.
Computes the Fuzzy Logic System output for a given input vector.
Adjust the consequent free parameters of the FIS (only avaliable with ANFIS engine), using the following methods
Gets the current system state.
Adjust the free parameters of the FIS (only avaliable with ANFIS engine), using the following methods
Adjust the free parameters of the FIS (only avaliable with ANFIS engine), using the following methods
Callback implementation for GenServer.init/1
.
Sets the Inference Engine type.
Sets the Learning rate (etha).
Spawns a Fuzzy Logic System.
Types
@type t() :: %Flex.System.State{ antecedent: [Flex.Variable.t(), ...], consequent: Flex.Variable.t(), engine_output: Flex.EngineAdapter.engine_state(), engine_type: Flex.EngineAdapter.Mamdani | Flex.EngineAdapter.TakagiSugeno | Flex.EngineAdapter.ANFIS, initial_gamma: number(), learning_rate: number(), rules: [Flex.Rule.t(), ...], sets_in_rules: list() }
Fuzzy Logic System state.
:rules
- (list) A list of rules that defines the behavior of the Fuzzy logic systems.:consequent
- Output variable.:antecedent
- a list of the input variables.:engine_type
- defines the inference engine behavior (default: Mamdini).:sets_in_rules
- list of sets involve in the rules (optional, required by ANFIS).:learning_rate
- is the speed at which the system parameters are adjusted (ANFIS only).:initial_gamma
- is the speed at which the system parameters are adjusted (LSE, ANFIS only).
Functions
@spec backward_pass( atom() | pid() | {atom(), any()} | {:via, atom(), any()}, number() ) :: {:ok, number()} | {:error, :einval}
Adjust the premise free parameters of the FIS (only avaliable with ANFIS engine), using the following methods:
- Learning method: Steepest gradient Backpropagation.
- Energy function: 0.5 * (target - output)^2
Returns a specification to start this module under a supervisor.
See Supervisor
.
Computes the Fuzzy Logic System output for a given input vector.
@spec forward_pass(atom() | pid() | {atom(), any()} | {:via, atom(), any()}, number()) :: {:ok, number()} | {:error, :einval}
Adjust the consequent free parameters of the FIS (only avaliable with ANFIS engine), using the following methods:
- Learning method: Steepest gradient Backpropagation.
- Energy function: 0.5 * (target - output)^2
Gets the current system state.
@spec hybrid_offline_learning( atom() | pid() | {atom(), any()} | {:via, atom(), any()}, list(), list(), number() ) :: {:ok, number()} | {:error, :einval}
Adjust the free parameters of the FIS (only avaliable with ANFIS engine), using the following methods:
- Forward method: Least Square Estimate.
- Learning method: Steepest gradient Backpropagation.
- Energy function: 0.5 * (target - output)^2 Note: this functions fires both forward and backward passes with a batch of data.
@spec hybrid_online_learning( atom() | pid() | {atom(), any()} | {:via, atom(), any()}, number() ) :: {:ok, number()} | {:error, :einval}
Adjust the free parameters of the FIS (only avaliable with ANFIS engine), using the following methods:
- Learning method: Steepest gradient Backpropagation.
- Energy function: 0.5 * (target - output)^2 Note: this functions fires both forward and backward passes.
Callback implementation for GenServer.init/1
.
@spec set_engine_type( atom() | pid() | {atom(), any()} | {:via, atom(), any()}, atom() ) :: :ok | {:error, :einval}
Sets the Inference Engine type.
@spec set_learning_rate( atom() | pid() | {atom(), any()} | {:via, atom(), any()}, number() ) :: :ok | {:error, :einval}
Sets the Learning rate (etha).
Spawns a Fuzzy Logic System.
The following options are require:
:rules
- Defines the behavior of the system based on a list of rules.:antecedent
- (list) Defines the input variables.:consequent
- Defines the output variable.