# LSTM - Scaling training data MinMaxScaler Flux alternative

**URL:** <https://discourse.julialang.org/t/lstm-scaling-training-data-minmaxscaler-flux-alternative/74323>\
**Category:** Machine Learning\
**Tags:** flux\
**Created:** [January 10, 2022, 8:17am UTC](https://discourse.julialang.org/t/lstm-scaling-training-data-minmaxscaler-flux-alternative/74323 "2022-01-10T08:17:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_Svanda](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jan_svanda/32/28810_2.png) [@Jan\_Svanda](https://discourse.julialang.org/u/Jan_Svanda)\
**Post date:** [January 10, 2022, 8:17am UTC](https://discourse.julialang.org/t/lstm-scaling-training-data-minmaxscaler-flux-alternative/74323/1 "2022-01-10T08:17:08Z")

</div>

I try to build a model of a dynamic system very similar to [Using PyTorch based LSTM to model nonlinear dynamic systems](https://towardsdatascience.com/a-long-short-term-memory-network-to-model-nonlinear-dynamic-systems-72f703885818) using Flux in Julia. I need to scale the train/test date to (-1,1) but I didn’t find a scaling function similar to PyTorch MinMaxScaler(feature\_range=(-1, 1)) . I believe that there is a simple way to scale date in Julia but I don’t know how 🙂.

Thanks in advance for the hints 👍

Jan

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [January 10, 2022, 9:12am UTC](https://discourse.julialang.org/t/lstm-scaling-training-data-minmaxscaler-flux-alternative/74323/2 "2022-01-10T09:12:13Z")

</div>

TableTransforms.jl is a general solution not related to Flux.jl. Maybe it can be useful to you.

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [January 11, 2022, 3:28am UTC](https://discourse.julialang.org/t/lstm-scaling-training-data-minmaxscaler-flux-alternative/74323/3 "2022-01-11T03:28:37Z")

</div>

[https://github.com/invenia/FeatureTransforms.jl](https://github.com/invenia/FeatureTransforms.jl) is a similar package if you want to work on arrays directly.
