//! # Smyl - A Machine Learning Library in Rust
//!
//! Smyl is a machine learning library written in Rust, providing a set of tools
//! and abstractions for building and training neural networks.
//!
//! ## Features
//!
//! - **Matrix Operations**: Smyl provides a `Matrix` struct for efficient
//!   matrix operations, including addition, subtraction, multiplication, and
//!   more. See the [`matrix`] module for details.
//! - **Activation Functions**: Smyl includes common activation functions such
//!   as `ReLU` and `Sigmoid`. These are defined in the [`activation`] module.
//! - **Layers**: Smyl defines two main layer types: `SignalLayer` and
//!   `SynapseLayer`, which can be used to build neural network architectures.
//!   See the [`network`] module.
//! - **Macros (optional)**: With the `macros` feature enabled, Smyl provides a
//!   set of macros to simplify the creation of neural networks. These are
//!   defined in the [`macros`] module.
//! - **Idx3 Support (optional)**: With the `idx3` feature enabled, Smyl can
//!   read and process data in the IDX3 format, commonly used for storing
//!   images. This is provided in the [`idx`] module.
//!
//! ## Getting Started
//!
//! To use Smyl, add the following to your `Cargo.toml` file:
//!
//! ```toml
//! [dependencies]
//! smyl = "0.1.1"
//! ```
//!
//! Then, in your Rust code, you can import the necessary modules from the
//! `prelude`:
//!
//! ```rust
//! use smyl::prelude::*;
//! ```
//!
//! ## Documentation
//!
//! For more detailed documentation, please refer to the individual module
//! documentation:
//!
//! - [`matrix`]: Matrix operations
//! - [`activation`]: Activation functions
//! - [`network`]: Neural network layers
//! - [`macros`]: Macros for simplifying neural network creation
//! - [`idx`]: IDX3 data format support
//!
//! ## Examples
//!
//! You can find example usage of Smyl in the [examples] directory of the
//! repository.

#[cfg(feature = "idx3")]
extern crate flate2;
#[cfg(feature = "random")]
pub extern crate rand;
#[cfg(feature = "serde")]
extern crate serde;
#[cfg(feature = "macros")]
pub extern crate smyl_macros as macros;

/// The `layer` module defines the core layer types used in the Smyl library.
pub mod network;

pub mod data;

pub mod maths;

/// The `prelude` module re-exports the most commonly used types and functions.
pub mod prelude {
    #[cfg(feature = "idx3")]
    pub use crate::data::idx::{Idx, Read, Reader};
    #[cfg(feature = "smyl-macros")]
    pub use crate::macros::{ann, mat};
    pub use crate::maths::activation::{Function, ReLU, Sigmoid};
    pub use crate::maths::matrix::Matrix;
    pub use crate::network::{LayerGradient, SynapseLayer};
}
