acid-0.1.0.0: Artificial Circuit Designer
Safe HaskellNone
LanguageHaskell2010

Torch.Extensions

Description

Extensions to Torch

Synopsis

Documentation

foldLoop' :: Int -> (a -> Int -> IO a) -> a -> IO a Source #

Swaps the arguments of HaskTorch's foldLoop around

nanToNum :: Float -> Float -> Float -> Tensor -> Tensor Source #

Because snake_case sucks

nanToNum' :: Tensor -> Tensor Source #

Default limits for nanToNum

nanToNum'' :: Tensor -> Tensor Source #

Default limits for nanToNum (0.0)

fullLike' :: Tensor -> Float -> Tensor Source #

GPU Tensor filled with Float value

indexSelect'' :: Int -> [Int] -> Tensor -> Tensor Source #

Select index with [Int] from GPU tensor

where'' :: Tensor -> (Tensor -> Tensor) -> Tensor -> Tensor Source #

Torch.where' with fixed type for where'

repeatInterleave' :: Int -> Tensor -> Tensor -> Tensor Source #

Syntactic sugar for HaskTorch's repeatInterleave so it can more easily be fmapped.

splitDim :: Int -> Tensor -> [Tensor] Source #

Helper function creating split indices as gpu int tensor splits' :: [Int] -> [T.Tensor] splits' = map tit . splits where tit i = T.asTensor (i :: Int)

Split Tensor into list of Tensors along dimension

boolMask :: Int -> [Int] -> Tensor Source #

Create Boolean Mask Tensor from list of indices.

boolMask' :: Int -> Tensor -> Tensor Source #

Create a Boolean Mask Tensor from index Tensor

manualSeed :: Int -> IO () Source #

Manually set RNG Seed

currentSeed :: IO Int Source #

Get the current RNG Seed

gpu :: Device Source #

GPU 1

cpu :: Device Source #

CPU 0

dataType :: DType Source #

Default Tensor Data Type

toTensor :: TensorLike a => a -> Tensor Source #

Convert an Array to a Tensor on GPU

toTensor' :: TensorLike a => a -> Tensor Source #

Convert an Array to a Tensor on CPU

toIntTensor :: TensorLike a => a -> Tensor Source #

Convert an Array to a Tensor on GPU

toIntTensor' :: TensorLike a => a -> Tensor Source #

Convert an Array to a Tensor on CPU

empty :: Tensor Source #

Create an empty Float Tensor on GPU

empty' :: Tensor Source #

Create an empty Float Tensor on CPU

toScalar :: Float -> Tensor Source #

Convert a Scalar to a Tensor on GPU

toScalar' :: Float -> Tensor Source #

Convert a Scalar to a Tensor on CPU

toDouble :: forall a. HasTypes a Tensor => a -> a Source #

Convert model to Double on GPU

toDouble' :: forall a. HasTypes a Tensor => a -> a Source #

Convert model to Double on CPU

toFloat :: forall a. HasTypes a Tensor => a -> a Source #

Convert model to Float on CPU

toFloat' :: forall a. HasTypes a Tensor => a -> a Source #

Convert model to Float on CPU

randomInts :: Int -> Int -> Int -> IO Tensor Source #

Generate a Tensor of random Integers on GPU

randomInts' :: Int -> Int -> Int -> IO Tensor Source #

Generate a Tensor of random Integers on CPU

normal' :: [Int] -> IO Tensor Source #

Generate Normally Distributed Random values given dimensions

uniform' :: [Int] -> Float -> Float -> IO Tensor Source #

Generate Uniformally distributed values in a given range

rescale :: Tensor -> Tensor Source #

Rescale tensor s.t. mean = 0.0 and std = 1.0