OccupancyNeuralNetwork<T>

Models & Types · AiDotNet.NeuralNetworks

Represents a Neural Network specialized for occupancy detection and prediction in spaces.

Inheritance: NeuralNetworkBase<T> → DeclaredModelLayoutBase<T> → VectorModelLayoutBase<T> → OccupancyNeuralNetwork<T>

For Beginners

Think of this network as a smart system that can “understand” when people are present in a room or building by analyzing data from various sensors. Just like you might determine if someone is in a room by noticing changes in temperature, sounds, or movement, this neural network learns patterns in sensor data that indicate human presence. It’s particularly useful for smart buildings, energy management, security systems, and space utilization analysis.

How It Works

An Occupancy Neural Network processes sensor data to detect and predict the presence and number of people in a given space. It can handle various types of sensor inputs including temperature, humidity, CO2 levels, motion detection, and other environmental factors.

Example

var points = Tensor<float>.CreateRandom(new[] { 1, 1000, 3 });
var trainX = Tensor<float>.CreateRandom(4, 8);
var trainY = Tensor<float>.CreateRandom(4, 2);
var result = new AiModelBuilder<float, Tensor<float>, Tensor<float>>()
    .ConfigureModel(new OccupancyNeuralNetwork<float>())
    .Build(trainX, trainY);
var occupancy = result.Predict(points);

Constructors

Constructor Summary
OccupancyNeuralNetwork() Initializes a new instance of the OccupancyNeuralNetwork class.
OccupancyNeuralNetwork(NeuralNetworkArchitecture<T> architecture, ILossFunction<T> lossFunction, OccupancyNeuralNetworkOptions options)

Properties

Property Summary
bool IncludesTemporalData { get; } Gets a value indicating whether this network processes temporal data.
bool SupportsTraining { get; }
int HistoryWindowSize { get; } Gets the size of the time window used for temporal data.

Methods

Method Summary
ModelMetadata<T> GetModelMetadata() Gets metadata about the occupancy neural network.
Tensor<T> ForwardTemporal(Tensor<T> input) Performs a forward pass through the network for temporal data.
Vector<T> UpdatePrediction(Vector<T> currentReading, Queue<Vector<T>> sensorHistory) Processes a new sensor reading and updates the prediction for real-time occupancy detection.