AlirezaMahDev.Extensions.Brain.Abstractions 0.0.1-alpha7

This is a prerelease version of AlirezaMahDev.Extensions.Brain.Abstractions.
dotnet add package AlirezaMahDev.Extensions.Brain.Abstractions --version 0.0.1-alpha7
                    
NuGet\Install-Package AlirezaMahDev.Extensions.Brain.Abstractions -Version 0.0.1-alpha7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AlirezaMahDev.Extensions.Brain.Abstractions" Version="0.0.1-alpha7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AlirezaMahDev.Extensions.Brain.Abstractions" Version="0.0.1-alpha7" />
                    
Directory.Packages.props
<PackageReference Include="AlirezaMahDev.Extensions.Brain.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AlirezaMahDev.Extensions.Brain.Abstractions --version 0.0.1-alpha7
                    
#r "nuget: AlirezaMahDev.Extensions.Brain.Abstractions, 0.0.1-alpha7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AlirezaMahDev.Extensions.Brain.Abstractions@0.0.1-alpha7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AlirezaMahDev.Extensions.Brain.Abstractions&version=0.0.1-alpha7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AlirezaMahDev.Extensions.Brain.Abstractions&version=0.0.1-alpha7&prerelease
                    
Install as a Cake Tool

AlirezaMahDev.Extensions.Brain.Abstractions

Project Description

This project defines the core abstractions and interfaces for the Brain extension, providing a contract-based approach to neural network operations. It serves as the foundation for the Brain implementation, enabling loose coupling and testability.

Dependencies

Project Dependencies

  • AlirezaMahDev.Extensions.DataManager.Abstractions: Provides data management abstractions for neural network persistence

Core Interfaces

INerve<TData>

The central interface representing a neural network, providing methods for training and inference:

  • Learn: Trains the network with provided data
  • Think: Performs inference on input data
  • Sleep: Optimizes the network state
  • Name: Identifies the nerve instance
  • Root: Provides access to the root connection

INeuron<TData>

Represents a single neuron in the network:

  • Offset: Memory offset of the neuron
  • RefValue: Direct reference to the neuron's value
  • RefData: Direct reference to the neuron's data
  • Connection: Gets or creates connections to other neurons

IConnection<TData>

Manages connections between neurons:

  • Location: Data location of the connection
  • Offset: Memory offset of the connection
  • Neuron: Connected neuron
  • Previous/Next: Navigation through connection chains

IBrainService

Service interface for managing neural network instances:

  • GetOrAdd<TData>: Retrieves or creates a named neural network

Data Structures

NeuronValue<TData>

Structure representing a neuron's state:

  • Data: The actual data stored in the neuron
  • Score: Activation score
  • Weight: Connection weight
  • Connection: Reference to connected neurons

ConnectionValue

Structure representing a connection between neurons:

  • Next: Reference to the next neuron in the connection chain
  • Weight: Strength of the connection

Design Principles

  1. Type Safety: Strongly-typed generic interfaces
  2. Separation of Concerns: Clear distinction between different neural network components
  3. Memory Efficiency: Uses value types and references where appropriate
  4. Extensibility: Designed to support various neural network architectures

Usage Example

// Get or create a neural network
var nerve = brainService.GetOrAdd<float[]>(networkName);

// Train the network
var trainingData = GetTrainingData();
nerve.Learn(trainingData);

// Perform inference
var input = new float[] { /* input data */ };
var result = nerve.Think(input);

Architecture

The project follows a clean architecture with:

  • Abstractions Layer: Defines the contracts for neural network operations
  • Data Structures: Provides the core data types used by the implementation
  • Service Contracts: Defines the service interfaces for neural network management

This design allows for different implementations while maintaining a consistent API for consumers.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AlirezaMahDev.Extensions.Brain.Abstractions:

Package Downloads
AlirezaMahDev.Extensions.Brain

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.1-alpha7 404 12/8/2025
0.0.1-alpha 272 12/7/2025