Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
FNN (Fuzzy Neural Network) Module Documentation
Overview
The FNN (Fuzzy Neural Network) module implements a hybrid intelligent system that combines neural networks with fuzzy logic principles. This implementation is specifically optimized for Arduino platforms, providing efficient computation while maintaining prediction accuracy.
Core Components
Class Structure
Key Features
Mathematical Foundation
1. Network Architecture
Input Layer
inputSize
(user-defined)std::vector<float>
Hidden Layer
Computation formula:
Where:
Output Layer
Final computation:
Parameters:
2. Learning Process
Loss Function (MSE)
Components:
Weight Update Rule
Where:
Class Reference
Constructor
Parameters:
inputSize
: Number of input neuronsbias
: Initial bias valueactivation
: Activation function (defaults to sigmoid)Public Methods
setWeights
Purpose: Sets network layer weights
Parameters:
newWeights
: Vector of weight valuesValidation: Checks dimension compatibility
setBiases
Purpose: Sets layer biases
Parameters:
newBiases
: Vector of bias valuesValidation: Verifies vector size
setFuzzyRules
Purpose: Defines fuzzy classification rules
Parameters:
rules
: Map of linguistic terms to numeric valuesTraining Methods
train
Purpose: Trains the network
Parameters:
inputs
: Training data matrixtargets
: Expected outputsepochs
: Training iterationslearningRate
: Learning rateActivation Functions
1. Sigmoid
Implementation:
Use case: General classification tasks
2. Hyperbolic Tangent
Implementation:
Use case: Normalized data ranges
3. Leaky ReLU
Implementation:
Use case: Deep networks, preventing dying ReLU
Evaluation Metrics
Accuracy
Calculation:
Precision
Calculation:
Implementation Guide
Basic Setup
Configuration
Training Configuration
Example Usage
Complete Arduino Implementation
Performance Optimization
Error Handling
The module includes comprehensive error checking:
Contributing
Contributions are welcome. Please follow the standard pull request process:
Support
For issues and feature requests, please create an issue in the repository.
Author