Copyright | (c) Artur M. Brodzki 2018 |
---|---|
License | BSD3 |
Maintainer | artur@brodzki.org |
Stability | experimental |
Portability | Windows/POSIX |
Safe Haskell | None |
Language | Haskell2010 |
- This module provides convenient constructors that generates a linear functionals
- Finitely-dimensional functionals provide much greater performance that infinitely-dimensional
Synopsis
- fromIndices :: Num a => String -> Int -> (Int -> a) -> Tensor a
- const :: Num a => String -> Int -> a -> Tensor a
- randomDouble :: ContGen d => String -> Int -> d -> IO (Tensor Double)
- randomDoubleSeed :: (ContGen d, PrimMonad m) => String -> Int -> d -> Int -> m (Tensor Double)
- randomInt :: DiscreteGen d => String -> Int -> d -> IO (Tensor Int)
- randomIntSeed :: (DiscreteGen d, PrimMonad m) => String -> Int -> d -> Int -> m (Tensor Int)
- fromIndices' :: Num a => String -> (Int -> a) -> Tensor a
- const' :: Num a => String -> a -> Tensor a
Generators
Finite functionals
:: Num a | |
=> String | Index name (one character) |
-> Int | Number of elements |
-> (Int -> a) | Generator function - returns a linear functional component at index |
-> Tensor a | Generated linear functional |
Generate linear functional as function of indices
:: Num a | |
=> String | Index name (one character) |
-> Int | Number of elements |
-> a | Value of each element |
-> Tensor a | Generated linear functional |
Generate linear functional with all components equal to some v
:: ContGen d | |
=> String | Index name (one character) |
-> Int | Number of elements |
-> d | Continuous probability distribution (as from Statistics.Distribution) |
-> IO (Tensor Double) | Generated linear functional |
Generate linear functional with random real components with given probability distribution. The functional is wrapped in the IO monad.
Available probability distributions:
- Beta : Statistics.Distribution.BetaDistribution
- Cauchy : Statistics.Distribution.CauchyLorentz
- Chi-squared : Statistics.Distribution.ChiSquared
- Exponential : Statistics.Distribution.Exponential
- Gamma : Statistics.Distribution.Gamma
- Normal : Statistics.Distribution.Normal
- StudentT : Statistics.Distribution.StudentT
- Uniform : Statistics.Distribution.Uniform
- F : Statistics.Distribution.FDistribution
- Laplace : Statistics.Distribution.Laplace
:: (ContGen d, PrimMonad m) | |
=> String | Index name (one character) |
-> Int | Number of elements |
-> d | Continuous probability distribution (as from Statistics.Distribution) |
-> Int | Randomness seed |
-> m (Tensor Double) | Generated linear functional |
Generate linear functional with random real components with given probability distribution and given seed. The functional is wrapped in a monad.
Available probability distributions:
- Beta : Statistics.Distribution.BetaDistribution
- Cauchy : Statistics.Distribution.CauchyLorentz
- Chi-squared : Statistics.Distribution.ChiSquared
- Exponential : Statistics.Distribution.Exponential
- Gamma : Statistics.Distribution.Gamma
- Normal : Statistics.Distribution.Normal
- StudentT : Statistics.Distribution.StudentT
- Uniform : Statistics.Distribution.Uniform
- F : Statistics.Distribution.FDistribution
- Laplace : Statistics.Distribution.Laplace
:: DiscreteGen d | |
=> String | Index name (one character) |
-> Int | Number of elements |
-> d | Discrete probability distribution (as from Statistics.Distribution) |
-> IO (Tensor Int) | Generated linear functional |
Generate linear functional with random integer components with given probability distribution. The functional is wrapped in the IO monad.
Available probability distributions:
- Binomial : Statistics.Distribution.Binomial
- Poisson : Statistics.Distribution.Poisson
- Geometric : Statistics.Distribution.Geometric
- Hypergeometric: Statistics.Distribution.Hypergeometric
:: (DiscreteGen d, PrimMonad m) | |
=> String | Index name (one character) |
-> Int | Number of elements |
-> d | Discrete probability distribution (as from Statistics.Distribution) |
-> Int | Randomness seed |
-> m (Tensor Int) | Generated linear functional |
Generate linear functional with random integer components with given probability distribution and given seed. The functional is wrapped in a monad.
Available probability distributions:
- Binomial : Statistics.Distribution.Binomial
- Poisson : Statistics.Distribution.Poisson
- Geometric : Statistics.Distribution.Geometric
- Hypergeometric: Statistics.Distribution.Hypergeometric