<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>TensorFlow on jeffcarp</title>
    <link>/categories/tensorflow/</link>
    <description>Recent content in TensorFlow on jeffcarp</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 31 Aug 2019 11:13:25 -0700</lastBuildDate>
    <atom:link href="/categories/tensorflow/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Things I Learned as a First-Time Intern Host</title>
      <link>/posts/2019/things-i-learned-first-time-intern-host/</link>
      <pubDate>Sat, 31 Aug 2019 11:13:25 -0700</pubDate>
      <guid>/posts/2019/things-i-learned-first-time-intern-host/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;baybridge.jpg&#34; alt=&#34;The Bay Bridge&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;I hosted an intern for the first time this summer. It was my first time being&#xA;somebody&amp;rsquo;s manager and it became a huge learning experience for me as well as a&#xA;really fun time. My intern worked on &lt;a href=&#34;https://bugs.chromium.org/p/chromium/issues/list?mode=chart&amp;amp;q=Component%3ABlink&amp;amp;can=2&#34;&gt;adding many features to velocity-tracking&#xA;charts&lt;/a&gt;,&#xA;&lt;a href=&#34;https://chromium.googlesource.com/infra/infra/+/master/appengine/monorail/tools/ml/trainer2/&#34;&gt;rewriting our ML models in TensorFlow&#xA;2.0&lt;/a&gt;,&#xA;and a few other projects.&lt;/p&gt;&#xA;&lt;p&gt;Here are the biggest areas where I struggled as a host and the important&#xA;lessons I took away from those experiences.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Doing Cryptography in TensorFlow</title>
      <link>/posts/2018/cryptography-in-tensorflow/</link>
      <pubDate>Sat, 23 Jun 2018 13:00:14 -0700</pubDate>
      <guid>/posts/2018/cryptography-in-tensorflow/</guid>
      <description>&lt;!--&#xA;After building a system with TensorFlow in Autumn 2017 and taking a course&#xA;on Cryptography in Winter 2018, I saw some interesting parallels.&#xA;&#xA;TensorFlow is marketed as a Machine Learning framework, but under the hood it&#39;s&#xA;a general platform for doing computations in the structure of a graph.&#xA;Similarly, cryptographic algorithms are frequently structured as the&#xA;manipulation of vectors or matrices in the structure of a graph. I put together&#xA;a Python notebook to explore this interesting relationship.&#xA;--&gt;&#xA;&lt;figure&gt;&#xA;  &lt;div style=&#34;display:flex;&#34;&gt;&#xA;    &lt;div style=&#34;flex:1;&#34;&gt;&#xA;        &lt;img src=&#34;feistel.gif&#34; alt=&#34;A Feistel Network, the algorithm behind DES.&#34; /&gt;&#xA;    &lt;/div&gt;&#xA;    &lt;div style=&#34;flex:1;&#34;&gt;&#xA;        &lt;img src=&#34;nnet.png&#34; alt=&#34;A neural network.&#34; /&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;figcaption&gt;&#xA;    On the left: the Feistel Network from the DES cipher, implemented below. On the right: a deep neural network.&#xA;  &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;a href=&#34;https://www.tensorflow.org/&#34;&gt;TensorFlow&lt;/a&gt;&lt;/strong&gt; is a popular machine learning&#xA;framework. If you look under the hood, TensorFlow is a general platform for&#xA;doing computation over tensors in the structure of a graph.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Export Evaluation Results in Tensorflow</title>
      <link>/posts/2018/export-evaulation-results-tensorflow/</link>
      <pubDate>Fri, 05 Jan 2018 21:33:26 -0700</pubDate>
      <guid>/posts/2018/export-evaulation-results-tensorflow/</guid>
      <description>&lt;p class=&#34;aside&#34;&gt;&#xA;  &lt;b&gt;2019 update:&lt;/b&gt; just a heads up, this post is about TensorFlow 1.x. For&#xA;  TensorFlow 2.x, you probably want to check out&#xA;  &lt;a href=&#34;https://www.tensorflow.org/guide/keras/custom_callback&#34;&gt;Keras custom&#xA;  callbacks&lt;/a&gt;.&#xA;&lt;/p&gt;&#xA;&lt;p&gt;In TensorFlow if you&amp;rsquo;re using a &lt;a href=&#34;https://www.tensorflow.org/api_docs/python/tf/estimator/Estimator&#34;&gt;&lt;code&gt;tf.estimator&lt;/code&gt;&lt;/a&gt; model, for instance &lt;a href=&#34;https://www.tensorflow.org/api_docs/python/tf/estimator/DNNLinearCombinedClassifier&#34;&gt;&lt;code&gt;tf.estimator.DNNLinearCombinedClassifier&lt;/code&gt;&lt;/a&gt;, and as part of your automated training infrastructure you want to save the evaluation results as a JSON file, it&amp;rsquo;s not super straightforward, so here&amp;rsquo;s how to do it.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say you define your &lt;code&gt;EvalSpec&lt;/code&gt; like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;eval_spec &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; tf&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;estimator&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;EvalSpec(eval_input_fn,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  steps&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;hparams&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;eval_steps,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  exporters&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;[exporter],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  name&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;eval&amp;#39;&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;You&amp;rsquo;ll need to write a new exporter class that will take the &lt;code&gt;eval_result&lt;/code&gt; from your evaluation step and save it to a file using the &lt;code&gt;GFile&lt;/code&gt; API.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Example: Save and Load a TensorFlow Model</title>
      <link>/posts/2017/save-and-load-tensorflow-model/</link>
      <pubDate>Sun, 19 Nov 2017 19:07:30 +0000</pubDate>
      <guid>/posts/2017/save-and-load-tensorflow-model/</guid>
      <description>&lt;p class=&#34;aside&#34;&gt;&#xA;  &lt;b&gt;2020 update:&lt;/b&gt; just a heads up, this post is about TensorFlow 1.x. For&#xA;  TensorFlow 2.x, you probably want to check out&#xA;  &lt;a href=&#34;https://www.tensorflow.org/tutorials/keras/save_and_load&#34;&gt;this guide&#xA;  &lt;/a&gt;.&#xA;&lt;/p&gt;&#xA;&lt;p&gt;This post details how to save and load a TensorFlow model using the &lt;code&gt;DNNClassifier&lt;/code&gt; API.&lt;/p&gt;&#xA;&lt;p&gt;The key idea here is that you define a function or a class beforehand that takes a model directory (in which it will save and restore the model parameters), adds that to &lt;code&gt;RunConfig&lt;/code&gt;, and returns a &lt;code&gt;tf.contrib.learn.Estimator&lt;/code&gt;, for example, &lt;code&gt;tf.contrib.learn.DNNClassifier&lt;/code&gt;. See &lt;code&gt;make_estimator&lt;/code&gt; for more details.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
