tensorflow-0.1.0.2: TensorFlow bindings.

Safe HaskellNone
LanguageHaskell2010

TensorFlow.Session

Synopsis

Documentation

data SessionT m a Source #

Instances

MonadTrans SessionT Source # 

Methods

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

Monad m => Monad (SessionT m) Source # 

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 #

fail :: String -> SessionT m a #

Functor m => Functor (SessionT m) Source # 

Methods

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

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

Monad m => Applicative (SessionT m) Source # 

Methods

pure :: a -> SessionT m a #

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

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

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

MonadIO m => MonadIO (SessionT m) Source # 

Methods

liftIO :: IO a -> SessionT m a #

MonadThrow m => MonadThrow (SessionT m) Source # 

Methods

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

MonadMask m => MonadMask (SessionT m) Source # 

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

MonadCatch m => MonadCatch (SessionT m) Source # 

Methods

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

Monad m => MonadBuild (SessionT m) Source # 

Methods

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

data Options Source #

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

Instances

Default Options Source # 

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.

Minimal complete definition

build

Methods

build :: Build a -> m a Source #

Instances

Monad m => MonadBuild (BuildT m) Source # 

Methods

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

Monad m => MonadBuild (SessionT m) Source # 

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.