Questions tagged [flux.jl]

For questions related to flux.jl – a machine learning library for Julia programming language.

Flux.jl is a machine learning library for Julia programming language. It has the following list of advantages.

Compiled Eager Code:

Flux provides a single, intuitive way to define models, just like mathematical notation. Julia transparently compiles your code, optimising and fusing kernels for the GPU, for the best performance.

Differentiable Programming:

Existing Julia libraries are differentiable and can be incorporated directly into Flux models. Cutting edge models such as Neural ODEs are first class, and Zygote enables overhead-free gradients.

First-class GPU support:

GPU kernels can be written directly in Julia via CUDA.jl. Flux is uniquely hackable and any part can be tweaked, from GPU code to custom gradients and layers.

The Model Zoo:

A rich collection of Flux scripts to learn from, or tweak to your own data. Trained Flux models can be used from TextAnalysis or Metalhead.

TPUs & Colab:

Flux models can be compiled to TPUs for cloud supercomputing, and run from Google Colab notebooks.

152 questions
16
votes
2 answers

In what way(s) can I benchmark a Julia function?

Background I've self-taught myself machine learning and have recently started delving into the Julia Machine Learning Ecosystem. Coming from a python background and having some Tensorflow and OpenCV/skimage experience, I want to benchmark Julia ML…
PseudoCodeNerd
  • 673
  • 5
  • 14
14
votes
1 answer

Julia: How to update to the latest version of a package (i.e. Flux)

I have Julia 1.1 I want to update to the latest version of a package, in this case Flux 8.3.0 according to documentetiation of Flux.jl when I type Pkg.status("Flux") I get Status `~/.julia/environments/v1.1/Project.toml` [587475ba] Flux v0.6.10 I…
ecjb
  • 5,169
  • 12
  • 43
  • 79
10
votes
0 answers

How to use a pre-trained model in Flux.jl?

I'm using the Flux library in Julia. How can I import an Inception neural network into it? I've seen that the following can be done in Mocha.jl to import a pre-trained net. using HDF5 h5open("model/bvlc_reference_caffenet.hdf5", "r") do h5 …
mjsxbo
  • 2,116
  • 3
  • 22
  • 34
7
votes
1 answer

Julia Flux error: SGD optimiser is undefined

I want to use the SGD optimiser in Flux as shown in the Julia Academy tutorial for Deep Learning with Flux.jl. This the notebook they provided in which they use the SGD optimizer as: opt = SGD(params(model)) However when I run SGD I get: ERROR:…
TheComputerM
  • 1,281
  • 2
  • 5
  • 10
7
votes
1 answer

Using quantile in Flux (Julia) in loss function

I am trying to use quantile in a loss function to train! (for some robustness, like least trimmed squares), but it mutates the array and Zygote throws an error Mutating arrays is not supported, coming from sort! . Below is a simple example (the…
MR_MPI-BGC
  • 265
  • 3
  • 11
7
votes
0 answers

Input Text Data Formatting for CNN in Flux, in Julia

I am implementing Yoon Kim's CNN (https://arxiv.org/abs/1408.5882) for text classification in Julia, using Flux as the deep learning framework, with individual sentences as input datapoints. The model zoo (https://github.com/FluxML/model-zoo) has…
6
votes
1 answer

What is the purpose of [extras] and [targets] in a Julia Project.toml?

In the following example (code copied from the Flux project.toml) what is the purpose of the [extras] and [targets] sections? [compat] Adapt = "3.0" ArrayInterface = "3.1, 4, 5, 6" CUDA = "3" . . . Zygote = "0.6.34" julia =…
vikram-s-narayan
  • 538
  • 4
  • 12
6
votes
0 answers

I have a problem precompile the Flux package in Julia

I am trying to add Flux into my package repository in Julia but I am getting an error. I typed pkg> add Flux but Julia REPL returns "5 dependencies errored". And they are: LLVM GPUCompiler CUDA NNlibCUDA Flux To see a full report either run import…
5
votes
1 answer

Calculating Hessian of a loss function including a NN w.r.t parameters in Julia using Zygote

How would you calculate a hessian of a loss function that consists of a Neural Network w.r.t. the NN's parameters? For instance, consider the loss function below using Flux: Chain, Dense, σ, crossentropy, params using Zygote model = Chain( x ->…
Miss Swiss
  • 89
  • 1
  • 9
5
votes
1 answer

Can't get Julia Flux to work for simple linear regression test

I'm a Julia user new to Flux and machine learning. As a first test and to understand how Flux works, I tried using Flux to estimate a simple linear regression model. But clearly I'm doing something wrong, as training the model using train! does…
A. Harris
  • 117
  • 3
5
votes
1 answer

Julia Flux, images with different dimension in neural network

I would like to recognize if a cell is infected by malaria or not (https://www.kaggle.com/iarunava/cell-images-for-detecting-malaria). But the pictures have different size, so I want to resize every image to the same size to be able to use my first…
Zul Huky
  • 331
  • 4
  • 24
5
votes
1 answer

Julia ML: Is there a recommended data format for loading data to Flux, Knet, Deep Learning Libraries

I use Tensorflow for deep learning work, but I was interested in some of the features of Julia for ML. Now in Tensorflow, there is a clear standard that protocol buffers--meaning TFRecords format is the best way to load sizable datasets to the GPUs…
krishnab
  • 9,270
  • 12
  • 66
  • 123
4
votes
1 answer

Julia Flux withgradient operation

I am a newbie to Julia and Flux with some experience in Tensorflow Keras and python. I tried to use the Flux.withgradient command to write a user-defined training function with more flexibility. Here is the training part of my code: loss, grad =…
PokeLu
  • 767
  • 8
  • 17
4
votes
2 answers

Double Broadcasting in Julia for Matrix Vector Addition?

Newbie Julia question here. Given two arrays, W = [randn(3,2), randn(3,2)] b = [randn(3), randn(3)] I would like to do a "nested broadcast" along the lines of, W .+ b = [W[1].+b[1], W[2].+b[2]] So far the best I've been able to come up with…
KCQs
  • 86
  • 1
  • 11
4
votes
0 answers

How can I optimize a recurrent network in Julia with Flux?

I have a recurrent neural network in Flux of the form: net = Chain(LSTM(8,100), Dense(100,1)) The input to the network are minute bars of stock data (each of those bars having 8 numbers), where there can be a varying number of bars fed into the…
1
2 3
10 11