$ account FluxML
Flux.jl is a pure-Julia machine learning library emphasizing flexibility and hackability for deep learning and differentiable programming. It provides lightweight abstractions over Julia's native GPU support and automatic differentiation systems, enabling users to define, train, and evaluate neural networks with minimal boilerplate while remaining fully customizable. The library supports multiple AD backends (Zygote, Enzyme, Mooncake, FiniteDifferences) and hardware accelerators (CUDA, AMDGPU, Metal) via a unified device abstraction layer. The architecture centers around composable layers (Dense, Conv, RNN, etc.), optimization utilities, and training loops. Key entry points include the Flux module (src/Flux.jl) reexporting layers, optimizers, training functions (train!, trainstep!, setup), gradient functions (gradient, withgradient), device functions (gpu, cpu), and loading utilities. Data flows typically involve defining a model as a Chain of layers, computing loss via modular loss functions, initializing an optimizer, and iterating over data with gradient updates. Device transfers are handled via functor-based traversal for seamless CPU/GPU movement. Flux.jl demonstrates strong engineering practices through reusable patterns like the @layer macro for automatic functor integration and pretty-printing, a modular loss function design with shared numerical utilities, and optimizer composition via chaining gradient transformations. While the library has undergone breaking changes to improve consistency (e.g., v0.14.0 dropping Julia <1.9 support, v0.15.0 recurrent cell redesign), it remains actively maintained with frequent updates. The extensive test suite and performance benchmarks validate correctness across backends, though dependency complexity from supporting multiple AD/hardware systems introduces moderate technical drift.