Comments (4)
The actual raw data loads differently on a x64 and arm64, with the latter being wrong.
from fluxarchitectures.jl.
I had a similar problem. It has nothing to do with GPUs, but does fail more loudly on em.
prepare_data
creates an uninitialized array with similar
. and then doesn't fill it all up. Leading to random data being read as float, with some being NaNs.
To make it really obvious I replaced the similar
call with zeros(Float32, ... )
:
function prepare_data(data, poollength, datalength, horizon; normalise=true)
extendedlength = datalength + poollength
extendedlength > size(data, 1) && throw(ArgumentError("datalength $(datalength) larger than available data $(size(data, 1) - poollength)"))
(normalise == true) && (data = Flux.normalise(data, dims=1))
features = zeros(Float32, size(data, 2), poollength, 1, datalength) # CHANGED THIS
for i = 0:poollength - 1
for j = poollength:datalength
# \/ this j starts at poollength => 1:(poollength-1) will always be uninit data
features[:,i + 1,1,j] = data[j - i,:]
end
end
labels = circshift(data[1:datalength,1], -horizon)
return features, labels
end
and then
prepare_data(ones(Float32, 510, 3), 10, 500, 7, normalise=false)
> 3×10×1×500 Array{Float32, 4}:
[:, :, 1, 1] =
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
[:, :, 1, 2] =
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
[:, :, 1, 3] =
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
...
[:, :, 1, 498] =
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
[:, :, 1, 499] =
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
[:, :, 1, 500] =
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
There should be no zeros (aka uninit memory), but there is.
Edit, added comments to make the bug really obvious.
from fluxarchitectures.jl.
@KingBoomie Thanks a lot for spotting this!
from fluxarchitectures.jl.
Thanks for the quick fix!
This is now the most useful time series analysis package for me. <3
from fluxarchitectures.jl.
Related Issues (20)
- Data for Electricity has 321 users not 370 HOT 3
- How to run DARNN on GPU HOT 2
- Upcoming Flux v0.12 will possibly break models
- TPA-LSTM trains slower on GPU than on CPU HOT 4
- Register package HOT 2
- TagBot trigger issue HOT 12
- Latest Zygote/Flux throws error in DARNN example file HOT 3
- Horizon must be larger than poollength in examples
- Compilation fails on Julia 1.7 HOT 2
- How can LSTnet output a 2 dims times Array? HOT 3
- Issues training models on FluxBench HOT 5
- FluxArchitectures not working with Flux v0.13
- Error running LSTnet - Copy-Paste Code example HOT 4
- Zygote v0.6.44 breaks tests
- Doubt about Stacked LSTMs
- Zygote must be pinned to versions lower than 0.6.44
- Implementing TPALSTM using own data HOT 4
- `prepare_data` normalises data even when normalise is set to false
- Compatibility with Julia 1.9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluxarchitectures.jl.