This tag is intended for questions about or involving the usage of Flux: an open-source machine-learning library written in Julia. Flux takes full advantage of Julia's just-ahead-of-time compilation and exposes an intuitive and flexible interface to users, while still providing a layer-stacking-based interface for simpler models, and can be readily integrated with other Julia packages.
Questions tagged [flux-machine-learning]
19 questions
3
votes
1 answer
How to implement a One to Many RNN in FluxML (Julia Lang)?
There is a wide set of examples for how to create various RNN architectures in Python with TensorFlow and Pytorch, and that includes the 1-to-many architecture. The question is how this can be done in FluxML with Julia Lang. With Keras in TensorFlow…

Vass
- 2,682
- 13
- 41
- 60
3
votes
1 answer
How to load a trained model with BSON in Flux.jl
I trained a model earlier in Flux.jl and saved it by doing:
@save "mymodel.bson" model
Now I want to load that model back and use it again. How can I achieve this in Flux?

logankilpatrick
- 13,148
- 7
- 44
- 125
3
votes
2 answers
Logistic regression using Flux.jl
I have a dataset consisting of student marks in 2 subjects and the result if the student is admitted in college or not. I need to perform a logistic regression on the data and find the optimum parameter θ to minimize the loss and predict the results…

Akshay Sharma
- 85
- 8
2
votes
1 answer
Flux.jl GPU support for M1 Mac?
I am currently using a laptop with the M1 Mac chip. The Flux.jl docs only mention support for Nvidia GPU's. Is it possible to train my models using my local GPU or is there no support for the M1 Mac yet? Note: Julia 1.7 beta 3 is currently being…

logankilpatrick
- 13,148
- 7
- 44
- 125
2
votes
1 answer
How to use VGG19 in Flux.jl?
I have a specific computer vision problem that I want to try solving using some pre-trained models. The Flux.jl docs don't actually have any pre-trained models in them like some of the other ML frameworks (PyTorch as an example). How would I access…

logankilpatrick
- 13,148
- 7
- 44
- 125
2
votes
1 answer
How to do Adaptive average pooling in Flux.jl
I have seen that adaptive average pooling is available both in
Tensor Flow and PyTorch.
I am wondering how this can be achieved in Flux.jl?

logankilpatrick
- 13,148
- 7
- 44
- 125
2
votes
1 answer
Flux Loss function not reading data as expected
This is probably a pretty simple error on my end, but I cannot seem to figure it out. I'm trying to build an RNN that will learn numeric sequences. Example dataset (each row represents a data point)
0 0 0 1 3
0 0 0 0 0
0 0 1 3 0
...
I'm mainly…

Isaac De Vlugt
- 73
- 3
2
votes
1 answer
predicting ODE parameters with DiffEqFlux
I'm trying to build a neural network that will take in the solutions to a system of ODE's and predict the parameters of the system. I'm using Julia and in particular, the DiffEqFlux package. The structure of a network is a few simple Dense layers…

rkurchin
- 21
- 4
2
votes
1 answer
Dimensions Mismatch in julia
I'm getting this error:
DimensionMismatch("second dimension of A, 1, does not match length of x, 20")
for the following code. I'm trying to train a model on some sample data. I'm using the Flux machine learning library in Julia.
I've checked my…

mjsxbo
- 2,116
- 3
- 22
- 34
1
vote
0 answers
How to train Flux.jl to learn a sequence conditional to some initial "seeds"?
I am trying to write a RNN model that given an initial "seed" sequence, it reproduces the continuation of the sequence.
In the code above dummy sequences are generated as function of these initial seed points and a RNN approach is attempted, but…

Antonello
- 6,092
- 3
- 31
- 56
1
vote
1 answer
Trying to write a softmax and NNLib softmax giving unexpected output
I am working through a python book.. but using Julialang instead.. in order to learn the language etc... and I have come upon another area here where I am not quite clear ..
but when i start tossing more complex matrices it fell…

Erik
- 2,782
- 3
- 34
- 64
1
vote
2 answers
How does DiffEqFlux.sciml_train work for Neural ODEs in Julia?
I have a ganeral question about how Neural ODE Nets are trained in Julia. Are data points being sampled from the tspan on which the Nural ODE is defined and on them the parameter updates computed? In other words is there some shuffling and batching…

SimonAda
- 167
- 1
- 9
1
vote
1 answer
Fitting a neural network with ReLUs to polynomial functions
Out of curiosity I am trying to fit neural network with rectified linear units to polynomial functions.
For example, I would like to see how easy (or difficult) it is for a neural network to come up with an approximation for the function f(x) = x^2…

RikH
- 2,994
- 1
- 16
- 15
1
vote
1 answer
Julia: Flux.jl: "function gradient does not accept keyword arguments"
I'm trying to use Flux.jl v"0.6.10 (which I freshly installed and which looks like an awesome package) with Julia Version 1.1.0 and copied the following code from the "basic" section of the documation of flux.jl
using Flux.Tracker
f(x) = 3x^2 + 2x +…

ecjb
- 5,169
- 12
- 43
- 79
1
vote
0 answers
How do I correctly define a custom STE gradient in Flux?
I am trying to write a custom STE gradient using Flux. The activation is basically just the sign() function, and its gradient is the incoming gradient as is iff its absolute value is <=1, and cancelled other wise. The implementation I currently have…

Velix
- 53
- 1
- 5