generateme / fastmath Goto Github PK
View Code? Open in Web Editor NEWFast primitive based math library
License: MIT License
Fast primitive based math library
License: MIT License
SMILE's cholesky somehow throws an error when posterior samples are called which wasn't an issue with Apache Commons Math library
Since the code of this library includes primitive-math, which is MIT licensed, does fastmathโs license need to be something which at a minimum retains the attribution requirements of MIT, like MIT or Apache? It seems like the Unlicense canโt public domain something which is already MIT.
As per discussion on Slack, useful distributions might be added to the already available list.
A somewhat exhaustive list for implementation might be here as described in the gamlss.dist R package, including the ZAGA (Zero Adjusted Gamma) distribution.
Thanks for this excellent library!
Seems like this:
https://github.com/generateme/fastmath/blob/master/src/fastmath/core.clj#L1357-L1365
should be updated to include abs, as with the new refer-clojure exclude.
In testing a function that returns random vectors I came across the following issue, but I'm not sure what's going wrong here.
(repeat 5 (v/vec2 10 10))
; Error printing return value (ClassCastException) at fastmath.vector.Vec2/equals (vector.clj:333).
; clojure.lang.Symbol cannot be cast to fastmath.vector.Vec2
Doing this with normal Clojure vectors gives the correct result
(repeat 5 [10 10])
([10 10] [10 10] [10 10] [10 10] [10 10])
According to https://generateme.github.io/fastmath/fastmath.random.html#var-frandom, frandom
can be called with 1-3 params. Yet when I try to provide mx
and send it two, it fails:
๐ clj -Sdeps '{:deps {generateme/fastmath {:mvn/version "2.0.5"}}}'
user=> (require '[fastmath.random :as fm.rand])
user=> (fm.rand/frandom (fm.rand/distribution :gamma) 1)
Execution error (ArityException) at fastmath.protocols/eval1001$fn$G (protocols.clj:10).
Wrong number of args (2) passed to: fastmath.random/eval4162/fn--4185
What am I doing wrong? Thank you!
Useful in comparing TFIDF text representations, instead of using cosine
https://en.wikipedia.org/wiki/Cosine_similarity#Soft_cosine_measure
The similarity function s_i_j should be plugable (as input to the function)
Hi there!
We love fastmath!
Just a small nitpick (it actually broke our deployment pipeline ๐ ):
Fastmath includes com.github.haifengl/smile-mkl
dependency which may lead to substantial resources (~800MB) being downloaded and included in the build.
This should be either configurable or at least mentioned in the Readme so as users may plan for this and optionally exclude this dependency from their deps tree.
Cheers
Miro
Strategies:
A top-level form in fastmath.random
:
(defonce ^:private ^RombergIntegrator romberg-integrator (RombergIntegrator.))
It makes integrate-pdf
not thread-safe. I have spent quite a few hours hunting down spurious TooManyEvaluationsException
only to realize that when I add more threads in order to try and circumvent the flakiness, I actually get guaranteed failures.
Messing with some pixel operations, scanning to eliminate blank pixels (naively), I want to filter out
[255.0 255.0 255.0 255.0] and record [x y] coords that are non-blank...
(defn extract-outline [pixels]
(let [blank [255.0 255.0 255.0 255.0]
[w h] ((juxt c2d/width c2d/height) pixels)]
(->> (for [x (range w)
y (range h)]
(let [p (p/get-color pixels x y)]
(when (not= p blank)
[x y])))
(filter identity)
vec)))
Input pixels is a result of to-pixels
from an image. I believe a vector4 buffer.
The problem is, =
between the vec4 that's stored in pixels and the literal 4-element vector I denoted is not considered structurally equal. So, every pixel is returned. I'm guessing the simple way out is to to use vec4 explicitly instead of clojure's vector. Is this intentional?
I noticed that the map comming back from clustering is "structurally different", depending how many (non-empty !) clusters it finds.
If I ask for 5 clusters, I would expect that the map I get back always has:
:clusters = 5
:sizes (s1 s2 s3 s4 s5)
I get sometimes this:
:sizes = ( 97 53 0 )
:clusters = 2
Hi! Thanks for this library, it has lots of great stuff in it and I'm enjoying playing around.
I have some existing code that generates audio waveforms as sequences of samples, so the design of the effect nodes as closures that operate sequentially on samples is great.
I am able to make a :simple-lowpass
effect and apply it to my sounds and it works as expected.
What I'd like to be able to do is vary (sweep) the cutoff frequency over time, and I don't see a way to do that currently.
fastmath/src/fastmath/signal.clj
Line 310 in 90cda5f
Maybe it would be good if (fastmath.signal/effect ...)
returned something that could update its parameters - I have in mind something akin to a VST effect, so parameters could be changed "during" processing.
Regardless, thank you again for this library, many useful functions here and I look forward to exploring it more.
Take care.
It would be great to have ClojureScript support for parts of fastmath, especially fastmath.random
.
If I try to launch lein repl
in master branch I get this error. I managed to pinpoint it to [clj-boost "0.0.4"]
dependency by commenting them out one by one. I am not an expert. I got to this problem when I tried to run the current version of Clojure2D/clojure2d-examples
.
Could not find artifact jdk.tools:jdk.tools:jar:1.8 at specified path C:\Program Files\Java\jre1.8.0_191/../lib/tools.jar
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Regards,
Adrian
IntervalUtils
is a small and useful collection of confidence interval functions:
https://commons.apache.org/proper/commons-math/javadocs/api-3.6/org/apache/commons/math3/stat/interval/IntervalUtils.html
Probably Fastmath wrappers could be useful.
Hello, I'm not sure whether I am using the library wrong, but I seem unable to get all triangles addressed, only every second one. I tried passing a third coordinate to toggle up/down triangles to cell->mid without effect. Can you give a hint on how to work with the triangle grid correctly?
What seems weird is that e.g.
user=> (g/corners gr (g/cell->mid gr [0 0]))
and
user=> (g/corners gr (g/cell->mid gr [1 0]))
give the same results for triangular grids. (Same for 2/3, 4/5 etc.) I thought maybe even/odd x coordinates are supposed to alternate up/down triangles? But this seems to be broken broken.
Thanks in advance!
For a long vectors (300 elements). Possible remedy: normalize first before making a dot product.
I would like to select relevant TFIDF features for machine learining.
One way to do this is:
https://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.chi2.html
I could not really see if fastmath
supports this currently ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.