Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module declares what is visible to use TensorSafe as an API.
Synopsis
- data JavaScript = JavaScript
- data Python = Python
- generate :: Generator l => l -> CNetwork -> Text
- generateFile :: Generator l => l -> CNetwork -> Text
- data INetwork :: [Type] -> [Shape] -> Type
- type family MkINetwork (layers :: [Type]) (sIn :: Shape) (sOut :: Shape) :: Type where ...
- mkINetwork :: ValidNetwork xs ss => INetwork xs ss
- toCNetwork :: forall i x xs ss. (SingI i, Layer x, ValidNetwork (x ': xs) (i ': ss)) => INetwork (x ': xs) (i ': ss) -> CNetwork
Documentation
data JavaScript Source #
Support for JavaScript compilation
Instances
Show JavaScript Source # | |
Defined in TensorSafe.Compile.Expr showsPrec :: Int -> JavaScript -> ShowS # show :: JavaScript -> String # showList :: [JavaScript] -> ShowS # | |
Generator JavaScript Source # | |
Defined in TensorSafe.Compile.Expr generate :: JavaScript -> CNetwork -> Text Source # generateFile :: JavaScript -> CNetwork -> Text Source # |
generate :: Generator l => l -> CNetwork -> Text Source #
Adds supports for a language. Generates a CNetwork to Text
generateFile :: Generator l => l -> CNetwork -> Text Source #
Similar to generate
, but also adds necessary header and module lines of text so as to
have the CNetwork compiled at a separate file.
data INetwork :: [Type] -> [Shape] -> Type Source #
A network that defines a specific sequence of layers with the corresponding shape
transformation along the network. It's an Instance of a Network: given a Network and a initial
Shape, this type structure can be generated automatically using the type functions defined in
this module, like Out
and MkINetwork
.
type family MkINetwork (layers :: [Type]) (sIn :: Shape) (sOut :: Shape) :: Type where ... Source #
Creates an INetwork type validating the the expected output and the computed one match.
MkINetworkUnconstrained ls sIn sOut = MaybeType (INetwork ls (ComposeOut ls sIn)) (ValidateOutput ls sIn sOut) |
mkINetwork :: ValidNetwork xs ss => INetwork xs ss Source #
Makes a valid instance of INetwork
toCNetwork :: forall i x xs ss. (SingI i, Layer x, ValidNetwork (x ': xs) (i ': ss)) => INetwork (x ': xs) (i ': ss) -> CNetwork Source #
Compilation: Gets the initial shape using Singleton instances. Since this is the function we
run for transforming an INetwork to CNetwork, the nested argument of toCNetwork'
is set
to False.