Comments (3)
Hello!
Definitely a bug, fixed.
Now it passes special values (like NaN and Inf) as symbols :nan, :inf, :neg_inf to all apply
functions. So, you can round numbers like this:
iex> Matrex.apply(m, fn x when is_float(x) -> Float.round(x)
...> o -> o
...> end)
or
iex(2)> Matrex.apply(m, fn x when x in [:nan, :inf, :neg_inf] -> -1
...(2)> x -> Float.round(x)
...(2)> end)
Please, give a try.
from matrex.
Hi!
Yup, it seems to be working great! Thanks for the quick fix @versilov!
As a side note, do you have a list of tasks/features that you plan on implementing in the array
branch? If you have any beginner level issues, I would be more than happy to help! 😄
from matrex.
Thank you for using this library, @goodhamgupta! You already help to debug it.
The main task, that I am stuck at right now in the array branch is displaying of multi-dimensional matrices. It does not require deep knowledge of the language, rather good algorithmic skills (which I lack).
# Our goal:
# Matrex[2×2×3×2×2]:int32
# ┌┌┌ ┐┌ ┐┌ ┐┐┐
# │││11111 11112││11211 11212││11311 11312│││
# │││11121 11122││11221 11222││11321 11322│││
# ││└ ┘└ ┘└ ┘││
# ││┌ ┐┌ ┐┌ ┐││
# │││12111 12112││12211 12212││12311 12312│││
# │││12121 12122││12221 12222││12321 12322│││
# │└└ ┘└ ┘└ ┘┘│
# │┌┌ ┐┌ ┐┌ ┐┐│
# │││21111 21112││21211 21212││21311 21312│││
# │││21121 21122││21221 21222││21321 21322│││
# ││└ ┘└ ┘└ ┘││
# ││┌ ┐┌ ┐┌ ┐││
# │││22111 22112││22211 22212││22311 22312│││
# │││22121 22122││22221 22222││22321 22322│││
# └└└ ┘└ ┘└ ┘┘┘
For now it's half-done, looks like this:
iex(3)> Matrex.random({2, 2, 3, 2, 2}, :int16)
#Matrex[2×2×3×2×2]:int16
831 6347 ││ 4338 1181 ││ 12238 3884 │││
│││ 1846 3181 ││ 4359 12171 ││ 305 8627 │││
└ ┘
│┌┌ ┐
│││ 1555 1125 ││ 1560 7162 ││ 4894 6021 │││
│││ 13590 3041 ││ 15878 2861 ││ 15376 15071 │││
└ ┘
│┌┌ ┐
│││ 10665 7267 ││ 11838 13686 ││ 3619 15967 │││
│││ 13945 13892 ││ 14153 12669 ││ 15818 7957 │││
└ ┘
│┌┌ ┐
│││ 734 3795 ││ 7647 4052 ││ 5177 2394 │││
│││ 3746 12972 ││ 5217 9171 ││ 12212 6705 │││
└ ┘
│┌┌ ┐
│││
from matrex.
Related Issues (16)
- Use :nan | :inf | :neg_inf instead of NaN | Inf | NegInf
- Talking to Numpy HOT 4
- Diagonal and Exponentials HOT 4
- Patter matching arrays problem HOT 3
- Do not use :io.columns on inspect HOT 1
- delete boobs function HOT 1
- Compilation Error on macOS 10.15 Catalina HOT 3
- Floating point issue for larger numbers HOT 3
- call to heatmap() results in ** (CompileError) console:1 "undefined function heatmap/1" HOT 1
- Benchmark against Numpy HOT 12
- Retrieve neighbours HOT 1
- Benchmark against Graphmath HOT 3
- Dirty schedulers and reductions HOT 2
- Support of different data types and multiple dimensions HOT 8
- Tag the releases in github HOT 1
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 matrex.