Flux.jl/README.md

51 lines
1.7 KiB
Markdown
Raw Normal View History

2016-04-01 21:11:42 +00:00
# Флукс
2017-03-17 15:14:42 +00:00
[![Build Status](https://travis-ci.org/MikeInnes/Flux.jl.svg?branch=master)](https://travis-ci.org/MikeInnes/Flux.jl) [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://mikeinnes.github.io/Flux.jl/stable) [![Join the chat at https://gitter.im/MikeInnes/Flux.jl](https://badges.gitter.im/MikeInnes/Flux.jl.svg)](https://gitter.im/MikeInnes/Flux.jl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2016-12-15 21:08:43 +00:00
2017-03-06 16:05:31 +00:00
Flux is a high-level library for machine learning, implemented in Julia.
2016-04-01 21:11:42 +00:00
2017-03-06 16:05:31 +00:00
Flux is designed to get the best performance (by running on TensorFlow or MXNet) while still being intuitive to work with you get good error messages, can step through models with the debugger, and the notation is very close to what you'd find in a paper.
2016-09-02 13:18:46 +00:00
2017-05-02 12:42:44 +00:00
Check out the [docs](https://mikeinnes.github.io/Flux.jl/stable/) to get started. Flux is in alpha so **please open issues liberally**; if something is broken for you it can most likely be fixed easily, or if you're not sure how to do something we can help.
2016-09-02 13:18:46 +00:00
2017-01-15 23:52:37 +00:00
## Brief Examples
2016-09-02 13:18:46 +00:00
2017-01-15 23:52:37 +00:00
Simple multi-layer-perceptron for MNIST:
2016-09-02 13:18:46 +00:00
```julia
2017-01-15 23:52:37 +00:00
Chain(
2016-09-02 13:18:46 +00:00
Input(784),
2016-11-14 22:16:00 +00:00
Affine(128), relu,
Affine( 64), relu,
Affine( 10), softmax)
2016-09-02 13:18:46 +00:00
```
2017-01-15 23:52:37 +00:00
LSTM example:
2016-09-02 13:18:46 +00:00
```julia
2017-01-15 23:52:37 +00:00
@net type LSTM
Wxf; Wyf; bf
Wxi; Wyi; bi
Wxo; Wyo; bo
Wxc; Wyc; bc
y; state
2016-09-02 13:18:46 +00:00
function (x)
2017-01-15 23:52:37 +00:00
# Gates
forget = σ( x * Wxf + y{-1} * Wyf + bf )
input = σ( x * Wxi + y{-1} * Wyi + bi )
output = σ( x * Wxo + y{-1} * Wyo + bo )
# State update and output
state = tanh( x * Wxc + y{-1} * Wyc + bc )
state = forget .* state{-1} + input .* state
y = output .* tanh(state)
2016-09-02 13:18:46 +00:00
end
end
2016-04-01 21:11:42 +00:00
2017-01-15 23:52:37 +00:00
Chain(
Input(N),
LSTM(N, 256),
LSTM(256, 256),
Affine(256, N),
softmax)
2016-09-02 13:18:46 +00:00
```