GithubHelp home page GithubHelp logo

cswaney / flux.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fluxml/flux.jl

0.0 0.0 0.0 8.09 MB

Relax! Flux is the ML library that doesn't make you tensor

Home Page: https://fluxml.ai/

License: Other

Julia 100.00%

flux.jl's Introduction

DOI Flux Downloads
ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

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.8 or later. Here's a simple example to try it out:

using Flux  # should install everything for you, including CUDA

x = hcat(digits.(0:3, base=2, pad=2)...) |> gpu  # let's solve the XOR problem!
y = Flux.onehotbatch(xor.(eachrow(x)...), 0:1) |> gpu
data = ((Float32.(x), y) for _ in 1:100)  # an iterator making Tuples

model = Chain(Dense(2 => 3, sigmoid), BatchNorm(3), Dense(3 => 2)) |> gpu
optim = Adam(0.1, (0.7, 0.95))
mloss(x, y) = Flux.logitcrossentropy(model(x), y)  # closes over model

Flux.train!(mloss, Flux.params(model), data, optim)  # updates model & optim

all((softmax(model(x)) .> 0.5) .== y)  # usually 100% accuracy.

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.

flux.jl's People

Contributors

mikeinnes avatar dhairyalgandhi avatar bors[bot] avatar carlolucibello avatar darsnack avatar mcabbott avatar avik-pal avatar saransh-cpp avatar thebhatman avatar touchesir avatar logankilpatrick avatar theabhirath avatar maetshju avatar somtambe avatar drchainsaw avatar maleadt avatar jeremiedb avatar racinmat avatar tejank10 avatar bhvieira avatar johnnychen94 avatar alha02 avatar mkschleg avatar staticfloat avatar oxinabox avatar janebert avatar adarshkumar712 avatar jw3126 avatar astupidbear avatar queensferryme avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.