typedflow-0.9: Typed frontend to TensorFlow and higher-order deep learning

Copyright(c) Jean-Philippe Bernardy 2017
LicenseLGPL-3
Maintainerjean-philippe.bernardy@gu.se
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

TypedFlow.Learn

Description

 

Synopsis

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.

Constructors

ModelOutput 

Fields

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.

data Options Source #

Model compiler options

Constructors

Options 

Fields

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).