mirror of
https://github.com/tensorflow/haskell.git
synced 2024-12-29 04:59:46 +01:00
19 lines
16 KiB
HTML
19 lines
16 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>TensorFlow.Logging</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">tensorflow-logging-0.2.0.1: TensorBoard related functionality.</span><ul class="links" id="page-menu"><li><a href="src/TensorFlow.Logging.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">TensorFlow.Logging</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>TensorBoard Summary generation. Provides type safe wrappers around raw
|
||
|
string emitting CoreOps.</p><p>Example use:</p><pre>-- Call summary functions while constructing the graph.
|
||
|
createModel = do
|
||
|
loss <- -- ...
|
||
|
TF.scalarSummary loss
|
||
|
|
||
|
-- Write summaries to an EventWriter.
|
||
|
train = TF.withEventWriter "/path/to/logs" $ \eventWriter -> do
|
||
|
summaryTensor <- TF.build TF.allSummaries
|
||
|
forM_ [1..] $ \step -> do
|
||
|
if (step % 100 == 0)
|
||
|
then do
|
||
|
((), summaryBytes) <- TF.run (trainStep, summaryTensor)
|
||
|
let summary = decodeMessageOrDie (TF.unScalar summaryBytes)
|
||
|
TF.logSummary eventWriter step summary
|
||
|
else TF.run_ trainStep</pre></div></div><div id="synopsis"><details id="syn"><summary>Synopsis</summary><ul class="details-toggle" data-details-id="syn"><li class="src short"><span class="keyword">data</span> <a href="#t:EventWriter">EventWriter</a></li><li class="src short"><a href="#v:withEventWriter">withEventWriter</a> :: (<a href="../base-4.13.0.0/Control-Monad-IO-Class.html#t:MonadIO" title="Control.Monad.IO.Class">MonadIO</a> m, MonadMask m) => <a href="../base-4.13.0.0/System-IO.html#t:FilePath" title="System.IO">FilePath</a> -> (<a href="TensorFlow-Logging.html#t:EventWriter" title="TensorFlow.Logging">EventWriter</a> -> m a) -> m a</li><li class="src short"><a href="#v:logEvent">logEvent</a> :: <a href="../base-4.13.0.0/Control-Monad-IO-Class.html#t:MonadIO" title="Control.Monad.IO.Class">MonadIO</a> m => <a href="TensorFlow-Logging.html#t:EventWriter" title="TensorFlow.Logging">EventWriter</a> -> <a href="../tensorflow-proto-0.3.0.0/Proto-Tensorflow-Core-Util-Event.html#t:Event" title="Proto.Tensorflow.Core.Util.Event">Event</a> -> m ()</li><li class="src short"><a href="#v:logGraph">logGraph</a> :: <a href="../base-4.13.0.0/Control-Monad-IO-Class.html#t:MonadIO" title="Control.Monad.IO.Class">MonadIO</a> m => <a href="TensorFlow-Logging.html#t:EventWriter" title="TensorFlow.Logging">EventWriter</a> -> <a href="../tensorflow-0.3.0.0/TensorFlow-Build.html#t:Build" title="TensorFlow.Build">Build</a> a -> m ()</li><li class="src short"><a href="#v:logSummary">logSummary</a> :: <a href="../base-4.13.0.0/Control-Monad-IO-Class.html#t:MonadIO" title="Control.Monad.IO.Class">MonadIO</a> m => <a href="TensorFlow-Logging.html#t:EventWriter" title="TensorFlow.Logging">EventWriter</a> -> <a href="../base-4.13.0.0/Data-Int.html#t:Int64" title="Data.Int">Int64</a> -> <a href="../tensorflow-proto-0.3.0.0/Proto-Tensorflow-Core-Framework-Summary.html#t:Summary" title="Proto.Tensorflow.Core.Framework.Summary">Summary</a> -> m ()</li><li class="src short"><span class="keyword">type</span> <a href="#t:SummaryTensor">SummaryTensor</a> = <a href="../tensorflow-0.3.0.0/TensorFlow-Tensor.html#t:Tensor" title="TensorFlow.Tensor">Tensor</a> <a href="../tensorflow-0.3.0.0/TensorFlow-Tensor.html#t:Value" title="TensorFlow.Tensor">Value</a> <a href="../bytestring-0.10.10.1/Data-ByteString.html#t:ByteString" title="Data.ByteString">ByteString</a></li><li class="src short"><a href="#v:histogramSummary">histogramSummary</a> :: (<a href="../tensorflow-0.3.0.0/TensorFlow-Build.html#t:MonadBuild" title="TensorFlow.Build">MonadBuild</a> m, <a href="../tensorflow-0.3.0.0/TensorFlow-Types.html#t:TensorType" title="TensorFlow.Types">TensorType</a> t, t <a href="../tensorflow-0.3.0.0/TensorFlow-Types.html#t:-47--61-" title="TensorFlow.Types">/=</a> <a href="../bytestring-0.10.10.1/Data-ByteString.html#t:ByteString" title="Data.ByteString">ByteString</a>, t <a href="../tensorflow-0.3.0.0/TensorFlow-Types.html#t:-47--61-" title="TensorFlow.Types">/=</a> <a href="../base-4.13.0.0/Data-Bool.html#t:Bool" title="Data.Bool">Bool</a>) => <a href="../bytestring-0.10.10.1/Data-ByteString.html#t:ByteString" title="Data.ByteString">ByteString</a> -> <a href="../tensorflow-0.3.0.0/TensorFlow-Tensor.html#t:Tensor" title="TensorFlow.Tensor">Tensor</a> v t -> m ()</li><li class="src short"><a href="#v:imageSummary">imageSummary</a> :: (<a href="../tensorflow-0.3.0.0/TensorFlow-Types.html#t:OneOf" title="TensorFlow.Types">OneOf</a> '[<a href="../base-4.13.0.0/Data-Word.html#t:Word8" title="Data.Word">Word8</a>, <a href="../base-4.13.0.0/Data-Word.html#t:Word16" title="Data.Word">Word16</a>, <a href="../base-4.13.0.0/Prelude.html#t:Float" title="Prelude">Float</a>] t, <a href="../tensorflow-0.3.0.0/TensorFlow-Build.html#t:MonadBuild" title="TensorFlow.Build">MonadBuild</a> m) => <a href="../bytestring-0.10.10.1/Data-ByteString.html#t:ByteString" title="Data.ByteString">ByteString</a> -> <a href="../tensorflow-0.3.0.0/TensorFlow-Tensor.html#t:Tensor" title="TensorFlow.Tensor">Tensor</a> v t -> m
|
||
|
applicable).</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:SummaryTensor" class="def">SummaryTensor</a> = <a href="../tensorflow-0.3.0.0/TensorFlow-Tensor.html#t:Tensor" title="TensorFlow.Tensor">Tensor</a> <a href="../tensorflow-0.3.0.0/TensorFlow-Tensor.html#t:Value" title="TensorFlow.Tensor">Value</a> <a href="../bytestring-0.10.10.1/Data-ByteString.html#t:ByteString" title="Data.ByteString">ByteString</a> <a href="#t:SummaryTensor" class="selflink">#</a></p><div class="doc"><p>Synonym for the tensors that return serialized Summary proto.</p></div></div><div class="top"><p class="src"><a id="v:histogramSummary" class="def">histogramSummary</a> :: (<a href="../tensorflow-0.3.0.0/TensorFlow-Build.html#t:MonadBuild" title="TensorFlow.Build">MonadBuild</a> m, <a href="../tensorflow-0.3.0.0/TensorFlow-Types.html#t:TensorType" title="TensorFlow.Types">TensorType</a> t, t <a href="../tensorflow-0.3.0.0/TensorFlow-Types.html#t:-47--61-" title="TensorFlow.Types">/=</a> <a href="../bytestring-0.10.10.1/Data-ByteString.html#t:ByteString" title="Data.ByteString">ByteString</a>, t <a href="../tensorflow-0.3.0.0/TensorFlow-Types.html#t:-47--61-" title="TensorFlow.Types">/=</a> <a href="../base-4.13.0.0/Data-Bool.html#t:Bool" title="Data.Bool">Bool</a>) => <a href="../bytestring-0.10.10.1/Data-ByteString.html#t:ByteString" title="Data.ByteString">ByteString</a> -> <a href="../tensorflow-0.3.0.0/TensorFlow-Tensor.html#t:Tensor" title="TensorFlow.Tensor">Tensor</a> v t -> m () <a href="src/TensorFlow.Logging.html#histogramSummary" class="link">Source</a> <a href="#v:histogramSummary" class="selflink">#</a></p><div class="doc"><p>Adds a <code><a href="../tensorflow-core-ops-0.3.0.0/TensorFlow-GenOps-Core.html#v:histogramSummary" title="TensorFlow.GenOps.Core">histogramSummary</a></code> node. The tag argument is intentionally
|
||
|
limited to a single value for simplicity.</p></div></div><div class="top"><p class="src"><a id="v:imageSummary" class="def">imageSummary</a> :: (<a href="../tensorflow-0.3.0.0/TensorFlow-Types.html#t:OneOf" title="TensorFlow.Types">OneOf</a> '[<a href="../base-4.13.0.0/Data-Word.html#t:Word8" title="Data.Word">Word8</a>, <a href="../base-4.13.0.0/Data-Word.html#t:Word16" title="Data.Word">Word16</a>, <a href="../base-4.13.0.0/Prelude.html#t:Float" title="Prelude">Float</a>] t, <a href="../tensorflow-0.3.0.0/TensorFlow-Build.html#t:MonadBuild" title="TensorFlow.Build">MonadBuild</a> m) => <a href="../bytestring-0.10.10.1/Data-ByteString.html#t:ByteString" title="Data.ByteString">ByteString</a> -> <a href="../tensorflow-0.3.0.0/TensorFlow-Tensor.html#t:Tensor" title="TensorFlow.Tensor">Tensor</a> v t -> m () <a href="src/TensorFlow.Logging.html#imageSummary" class="link">Source</a> <a href="#v:imageSummary" class="selflink">#</a></p><div class="doc"><p>Adds a <code><a href="../tensorflow-core-ops-0.3.0.0/TensorFlow-GenOps-Core.html#v:imageSummary" title="TensorFlow.GenOps.Core">imageSummary</a></code> node. The tag argument is intentionally
|
||
|
limited to a single value for simplicity.</p></div></div><div class="top"><p class="src"><a id="v:scalarSummary" class="def">scalarSummary</a> :: (<a href="../tensorflow-0.3.0.0/TensorFlow-Types.html#t:TensorType" title="TensorFlow.Types">TensorType</a> t, t <a href="../tensorflow-0.3.0.0/TensorFlow-Types.html#t:-47--61-" title="TensorFlow.Types">/=</a> <a href="../bytestring-0.10.10.1/Data-ByteString.html#t:ByteString" title="Data.ByteString">ByteString</a>, t <a href="../tensorflow-0.3.0.0/TensorFlow-Types.html#t:-47--61-" title="TensorFlow.Types">/=</a> <a href="../base-4.13.0.0/Data-Bool.html#t:Bool" title="Data.Bool">Bool</a>, <a href="../tensorflow-0.3.0.0/TensorFlow-Build.html#t:MonadBuild" title="TensorFlow.Build">MonadBuild</a> m) => <a href="../bytestring-0.10.10.1/Data-ByteString.html#t:ByteString" title="Data.ByteString">ByteString</a> -> <a href="../tensorflow-0.3.0.0/TensorFlow-Tensor.html#t:Tensor" title="TensorFlow.Tensor">Tensor</a> v t -> m () <a href="src/TensorFlow.Logging.html#scalarSummary" class="link">Source</a> <a href="#v:scalarSummary" class="selflink">#</a></p><div class="doc"><p>Adds a <code><a href="../tensorflow-core-ops-0.3.0.0/TensorFlow-GenOps-Core.html#v:scalarSummary" title="TensorFlow.GenOps.Core">scalarSummary</a></code> node.</p></div></div><div class="top"><p class="src"><a id="v:mergeAllSummaries" class="def">mergeAllSummaries</a> :: <a href="../tensorflow-0.3.0.0/TensorFlow-Build.html#t:MonadBuild" title="TensorFlow.Build">MonadBuild</a> m => m <a href="TensorFlow-Logging.html#t:SummaryTensor" title="TensorFlow.Logging">SummaryTensor</a> <a href="src/TensorFlow.Logging.html#mergeAllSummaries" class="link">Source</a> <a href="#v:mergeAllSummaries" class="selflink">#</a></p><div class="doc"><p>Merge all summaries accumulated in the <code><a href="../tensorflow-0.3.0.0/TensorFlow-Build.html#t:Build" title="TensorFlow.Build">Build</a></code> into one summary.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.23.0</p></div></body></html>
|