mathflow alternatives and similar packages
Based on the "Math" category.
Alternatively, view mathflow alternatives based on common mentions on social networks and blogs.
-
vector
An efficient implementation of Int-indexed arrays (both mutable and immutable), with a powerful loop optimisation framework . -
hgeometry
HGeometry is a library for computing with geometric objects in Haskell. It defines basic geometric types and primitives, and it implements some geometric data structures and algorithms. -
dimensional
Dimensional library variant built on Data Kinds, Closed Type Families, TypeNats (GHC 7.8+). -
numhask
A haskell numeric prelude, providing a clean structure for numbers and operations that combine them. -
poly
Fast polynomial arithmetic in Haskell (dense and sparse, univariate and multivariate, usual and Laurent) -
eigen
Haskel binding for Eigen library. Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of mathflow or a related project?
README
mathflow(Dependently typed tensorflow modeler)
This package provides a model of tensor-operations. The model is independent from tensorflow-binding of python and haskell, though this package generates python-code. tensor's dimensions and constraints are described by dependent types. The tensor-operations are based on tensorflow-api. Currently the model can be translated into python-code. To write this package, I refer to this neural network document and singletons.
Install
Install tensorflow of python and this package.
> sudo apt install python3 python3-pip
> pip3 install -U pip
> pip3 install tensorflow
> git clone [email protected]:junjihashimoto/mathflow.git
> cd mathflow
> stack install
Usage
About model
Model has a type of Tensor (dimensions:[Nat]) value-type output-type
.
dimensions
are tensor-dimensions.value-type
is a value type like Integer or Float of tensorflow-data-types.output-type
is a type of code which this package generates. PyString-type is used for generating python-code.
This package makes tensorflow-graph from the mode. The model's endpoint is always a tensor-type.
At first write graph by using arithmetic operators like (+,-,,/), % (which is matrix multiply) and tensorflow-functions. Mathflow.{TF,TF.NN,TF.Train} packages define Tensorflow-functions.
A example is below.
testMatMul :: Tensor '[2,1] Int PyString
testMatMul =
let n1 = (Tensor "tf.constant([[2],[3]])") :: Tensor '[2,1] Int PyString
n2 = (Tensor "tf.constant([[2,0],[0,1]])") :: Tensor '[2,2] Int PyString
y = (n2 %* n1) :: Tensor '[2,1] Int PyString
in y
Create model and run it
Write tensorflow-model.
testMatMul :: Tensor '[2,1] Int PyString
testMatMul =
let n1 = (Tensor "tf.constant([[2],[3]])") :: Tensor '[2,1] Int PyString
n2 = (Tensor "tf.constant([[2,0],[0,1]])") :: Tensor '[2,2] Int PyString
y = n2 %* n1 :: Tensor '[2,1] Int PyString
in y
Run the model. This run
function generates python-code and excecute the code by python.
main = do
(retcode,stdout,stderr) <- run testMatMul
print stdout