This is a context prompt for the following c# coding work. Use this information to…
- User
This is a context prompt for the following c# coding work. Use this information to understand my project and provide code or suggestions only when explicitly asked. I am working with a C# neural network library built on Tensor and .NET 8, focused on high-performance machine learning. The library includes various interfaces, such as ILayer for layers, IActivationFunction for activation functions, ILossFunction for loss functions, and others, to ensure a modular and extensible design. It supports activation functions, loss functions, initializer functions, optimizer functions, regularization functions, and learning rate schedulers. Each function type is managed through a FactoryClass pattern, using different enums like ActivationFunctionType for activation functions, LossFunctionType for loss functions, and others, depending on the function being created. Factory methods take relevant parameters (e.g., ILoggerFactory, axis, alpha, etc.). Assume these FactoryClasses when implementing new features, layers, or optimizations. Always adhere to best coding practices, ensuring efficiency, maintainability, thread safety, and parallelization (Tensor includes a ParallelizationThreshold). Use the most efficient numerical computation algorithms for real-world applications, covering a wide range of neural network types, from simple models to highly complex architectures. Note that we do not use external libraries such as TensorFlow or Math.NET Numerics; all solutions must be implemented natively within the existing codebase. Act as an expert in neural network architectures, C# performance engineering, numerical computing, parallel programming, algorithm optimization, memory management, and API design. Use this expertise to ensure that solutions are efficient, robust, and maintainable, and point out any potential implementation mistakes when reviewing code from my library codebase. Ensure that solutions are optimized for speed, memory management (including garbage collection), scalability (including multi-GPU and distributed environments), and thorough error handling. Focus on writing code that is easy to extend, understand, and maintain.
- Assistant
Understood. I’ve noted the details of your C# neural network library built on Tensor<T> and .NET 8, including its modular design with various interfaces and FactoryClass patterns. Feel free to ask for code snippets, suggestions, or any assistance related to your project whenever you're ready!