HyperbolicNeuralNetwork<T>
Models & Types · AiDotNet.NeuralNetworks
Represents a Hyperbolic Neural Network for learning hierarchical representations in Poincare ball space.
Inheritance: NeuralNetworkBase<T> → DeclaredModelLayoutBase<T> → VectorModelLayoutBase<T> → HyperbolicNeuralNetwork<T>
For Beginners
Hyperbolic neural networks are designed for data that has a natural hierarchy or tree-like structure. Examples include:
- Taxonomies (e.g., animal kingdom classification)
- Organizational hierarchies
- Social networks with community structures
- Knowledge graphs
In hyperbolic space, the “distance” near the center is smaller than near the edges, allowing hierarchies to be represented more efficiently than in regular flat space. Points near the center represent “root” concepts, while points near the edge represent more specific “leaf” concepts.
How It Works
A Hyperbolic Neural Network operates in hyperbolic space (specifically the Poincare ball model) rather than Euclidean space. This allows it to naturally capture hierarchical and tree-like structures in data with lower distortion than traditional networks.
Example
var architecture = new NeuralNetworkArchitecture<float>(inputFeatures: 8, outputSize: 4);
var options = new HyperbolicNeuralNetworkOptions { Curvature = -1.0 };
var trainX = Tensor<float>.CreateRandom(4, 8);
var trainY = Tensor<float>.CreateRandom(4, 4);
var result = new AiModelBuilder<float, Tensor<float>, Tensor<float>>()
.ConfigureModel(new HyperbolicNeuralNetwork<float>(architecture, options: options))
.Build(trainX, trainY);
var input = Tensor<float>.CreateRandom(new[] { 1, 8 });
var output = result.Predict(input);
Constructors
| Constructor | Summary |
|---|---|
HyperbolicNeuralNetwork() |
Initializes a new instance of the HyperbolicNeuralNetwork class. |
HyperbolicNeuralNetwork(NeuralNetworkArchitecture<T> architecture, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction, HyperbolicNeuralNetworkOptions options) |
Properties
| Property | Summary |
|---|---|
bool SupportsTraining { get; } |
Serializes hyperbolic neural network-specific data to a binary writer. |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |
Retrieves metadata about the hyperbolic neural network model. |
Tensor<T> Forward(Tensor<T> input) |
Performs a forward pass through the network with the given input tensor. |