tensorflow-0.3.0.0: TensorFlow bindings.
Safe HaskellNone
LanguageHaskell2010

TensorFlow.Session

Synopsis

Documentation

data SessionT m a Source #

Instances

Instances details
MonadTrans SessionT Source # 
Instance details

Defined in TensorFlow.Session

Methods

lift :: Monad m => m a -> SessionT m a #

Monad m => Monad (SessionT m) Source # 
Instance details

Defined in TensorFlow.Session

Methods

(>>=) :: SessionT m a -> (a -> SessionT m b) -> SessionT m b #

(>>) :: SessionT m a -> SessionT m b -> SessionT m b #

return :: a -> SessionT m a #

Functor m => Functor (SessionT m) Source # 
Instance details

Defined in TensorFlow.Session

Methods

fmap :: (a -> b) -> SessionT m a -> SessionT m b #

(<$) :: a -> SessionT m b -> SessionT m a #

MonadFail m => MonadFail (SessionT m) Source # 
Instance details

Defined in TensorFlow.Session

Methods

fail :: String -> SessionT m a #

Monad m => Applicative (SessionT m) Source # 
Instance details

Defined in TensorFlow.Session

Methods

pure :: a -> SessionT m a #

(<*>) :: SessionT m (a -> b) -> SessionT m a -> SessionT m b #

liftA2 :: (a -> b -> c) -> SessionT m a -> SessionT m b -> SessionT m c #

(*>) :: SessionT m a -> SessionT m b -> SessionT m b #

(<*) :: SessionT m a -> SessionT m b -> SessionT m a #

MonadIO m => MonadIO (SessionT m) Source # 
Instance details

Defined in TensorFlow.Session

Methods

liftIO :: IO a -> SessionT m a #

MonadCatch m => MonadCatch (SessionT m) Source # 
Instance details

Defined in TensorFlow.Session

Methods

catch :: Exception e => SessionT m a -> (e -> SessionT m a) -> SessionT m a

MonadMask m => MonadMask (SessionT m) Source # 
Instance details

Defined in TensorFlow.Session

Methods

mask :: ((forall a. SessionT m a -> SessionT m a) -> SessionT m b) -> SessionT m b

uninterruptibleMask :: ((forall a. SessionT m a -> SessionT m a) -> SessionT m b) -> SessionT m b

generalBracket :: SessionT m a -> (a -> ExitCase b -> SessionT m c) -> (a -> SessionT m b) -> SessionT m (b, c)

MonadThrow m => MonadThrow (SessionT m) Source # 
Instance details

Defined in TensorFlow.Session

Methods

throwM :: Exception e => e -> SessionT m a

Monad m => MonadBuild (SessionT m) Source # 
Instance details

Defined in TensorFlow.Session

Methods

build :: Build a -> SessionT m a Source #

data Options Source #

Customization for session. Use the lenses to update: sessionTarget, sessionTracer, sessionConfig.

Instances

Instances details
Default Options Source # 
Instance details

Defined in TensorFlow.Session

Methods

def :: Options

sessionConfig :: Lens' Options ConfigProto Source #

Uses the specified config for the created session.

sessionTarget :: Lens' Options ByteString Source #

Target can be: "local", ip:port, host:port. The set of supported factories depends on the linked in libraries.

sessionTracer :: Lens' Options Tracer Source #

Uses the given logger to monitor session progress.

runSession :: (MonadMask m, MonadIO m) => SessionT m a -> m a Source #

Run Session actions in a new TensorFlow session.

runSessionWithOptions :: (MonadMask m, MonadIO m) => Options -> SessionT m a -> m a Source #

Run Session actions in a new TensorFlow session created with the given option setter actions (sessionTarget, sessionConfig).

class Monad m => MonadBuild m where Source #

Lift a Build action into a monad, including any explicit op renderings.

Methods

build :: Build a -> m a Source #

Instances

Instances details
Monad m => MonadBuild (BuildT m) Source # 
Instance details

Defined in TensorFlow.Build

Methods

build :: Build a -> BuildT m a Source #

Monad m => MonadBuild (SessionT m) Source # 
Instance details

Defined in TensorFlow.Session

Methods

build :: Build a -> SessionT m a Source #

extend :: MonadIO m => SessionT m () Source #

Add all pending rendered nodes to the TensorFlow graph and runs any pending initializers.

Note that run, runWithFeeds, etc. will all call this function implicitly.

run :: (MonadIO m, Fetchable t a) => t -> SessionT m a Source #

Run a subgraph t, rendering any dependent nodes that aren't already rendered, and fetch the corresponding values for a.

runWithFeeds :: (MonadIO m, Fetchable t a) => [Feed] -> t -> SessionT m a Source #

Run a subgraph t, rendering any dependent nodes that aren't already rendered, feed the given input values, and fetch the corresponding result values for a.

run_ :: (MonadIO m, Nodes t) => t -> SessionT m () Source #

Run a subgraph t, rendering and extending any dependent nodes that aren't already rendered. This behaves like run except that it doesn't do any fetches.

runWithFeeds_ :: (MonadIO m, Nodes t) => [Feed] -> t -> SessionT m () Source #

Run a subgraph t, rendering any dependent nodes that aren't already rendered, feed the given input values, and fetch the corresponding result values for a. This behaves like runWithFeeds except that it doesn't do any fetches.

asyncProdNodes Source #

Arguments

:: (MonadIO m, Nodes t) 
=> t

Node to evaluate concurrently.

-> SessionT m () 

Starts a concurrent thread which evaluates the given Nodes forever until runSession exits or an exception occurs. Graph extension happens synchronously, but the resultant run proceeds as a separate thread.