Flux.jl
Relax! Flux is the ML library that doesn't make you tensor
Install / Use
/learn @FluxML/Flux.jlREADME
Flux is an elegant approach to machine learning. It's a 100% pure-Julia stack, and provides lightweight abstractions on top of Julia's native GPU and AD support. Flux makes the easy things easy while remaining fully hackable.
Works best with Julia 1.10 or later. Here's a very short example to try it out:
using Flux
data = [(x, 2x-x^3) for x in -2:0.1f0:2]
model = let
w, b, v = (randn(Float32, 23) for _ in 1:3) # parameters
x -> sum(v .* tanh.(w*x .+ b)) # callable
end
# model = Chain(vcat, Dense(1 => 23, tanh), Dense(23 => 1, bias=false), only)
opt_state = Flux.setup(Adam(), model)
for epoch in 1:100
Flux.train!((m,x,y) -> (m(x) - y)^2, model, data, opt_state)
end
using Plots
plot(x -> 2x-x^3, -2, 2, label="truth")
scatter!(model, -2:0.1f0:2, label="learned")
In Flux 0.15, almost any parameterised function in Julia is a valid Flux model -- such as this closure over w, b, v. The same function can also be implemented with built-in layers as shown.
The quickstart page has a longer example. See the documentation for details, or the model zoo for examples. Ask questions on the Julia discourse or slack.
If you use Flux in your research, please cite our work.
Related Skills
feishu-drive
336.5k|
things-mac
336.5kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
336.5kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
yu-ai-agent
1.9k编程导航 2025 年 AI 开发实战新项目,基于 Spring Boot 3 + Java 21 + Spring AI 构建 AI 恋爱大师应用和 ReAct 模式自主规划智能体YuManus,覆盖 AI 大模型接入、Spring AI 核心特性、Prompt 工程和优化、RAG 检索增强、向量数据库、Tool Calling 工具调用、MCP 模型上下文协议、AI Agent 开发(Manas Java 实现)、Cursor AI 工具等核心知识。用一套教程将程序员必知必会的 AI 技术一网打尽,帮你成为 AI 时代企业的香饽饽,给你的简历和求职大幅增加竞争力。
