Copyright | (c) Jean-Philippe Bernardy 2017 |
---|---|
License | LGPL-3 |
Maintainer | jean-philippe.bernardy@gu.se |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
- categorical :: forall nCat bs. KnownNat nCat => Model '[nCat, bs] Float32 '[bs] Int32
- categoricalDistribution :: forall nCat bs. Model '[nCat, bs] Float32 '[nCat, bs] Float32
- timedCategorical :: forall len nCat bs bits. KnownNat nCat => KnownNat bs => KnownNat len => KnownBits bits => Tensor '[len, bs] (Flt bits) -> Tensor '[len, nCat, bs] (Flt bits) -> Tensor '[len, bs] Int32 -> Gen (ModelOutput '[len, nCat, bs] (Flt bits))
- data ModelOutput s t = ModelOutput {}
- type Model input tIn output tOut = T input tIn -> T output tOut -> Gen (ModelOutput output tOut)
- binary :: forall n bs. KnownNat bs => Model '[n, bs] Float32 '[n, bs] Int32
- data Options = Options {}
- defaultOptions :: Options
- compile :: forall sx tx sy ty sy_ ty_. (KnownShape sx, KnownTyp tx, KnownShape sy, KnownTyp ty, KnownShape sy_) => Options -> (Tensor sx tx -> Tensor sy ty -> Gen (ModelOutput sy_ ty_)) -> Gen ()
- compileGen :: forall sy ty. KnownShape sy => Options -> Gen (ModelOutput sy ty) -> Gen ()
Documentation
categorical :: forall nCat bs. KnownNat nCat => Model '[nCat, bs] Float32 '[bs] Int32 Source #
First type argument is the number of classes.
categorical logits gold
return (prediction, accuraccy, loss)
accuracy and prediction are averaged over the batch.
categoricalDistribution :: forall nCat bs. Model '[nCat, bs] Float32 '[nCat, bs] Float32 Source #
First type argument is the number of classes.
categoricalDistribution logits gold
return (prediction, accuraccy, loss)
accuracy and prediction are averaged over the batch.
timedCategorical :: forall len nCat bs bits. KnownNat nCat => KnownNat bs => KnownNat len => KnownBits bits => Tensor '[len, bs] (Flt bits) -> Tensor '[len, nCat, bs] (Flt bits) -> Tensor '[len, bs] Int32 -> Gen (ModelOutput '[len, nCat, bs] (Flt bits)) Source #
timedCategorical targetWeights logits y
targetWeights: a zero-one matrix of the same size as decoder_outputs. It is intended to mask padding positions outside of the target sequence lengths with values 0.
data ModelOutput s t Source #
Triple of values that are always output in a model: prediction, loss and accuracy.
type Model input tIn output tOut = T input tIn -> T output tOut -> Gen (ModelOutput output tOut) Source #
A standard modelling function: (input value, gold value) ↦ (prediction, accuracy, loss)
binary :: forall n bs. KnownNat bs => Model '[n, bs] Float32 '[n, bs] Int32 Source #
Model with several binary outputs.
Model compiler options
Options | |
|
defaultOptions :: Options Source #
default model compiler options
compile :: forall sx tx sy ty sy_ ty_. (KnownShape sx, KnownTyp tx, KnownShape sy, KnownTyp ty, KnownShape sy_) => Options -> (Tensor sx tx -> Tensor sy ty -> Gen (ModelOutput sy_ ty_)) -> Gen () Source #
compile a standard model
compileGen :: forall sy ty. KnownShape sy => Options -> Gen (ModelOutput sy ty) -> Gen () Source #
Generic a model with non-standard parameters ("x" and "y" must be provided as placeholders manually).