<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Machine Learning on jeffcarp</title>
    <link>/categories/machine-learning/</link>
    <description>Recent content in Machine Learning on jeffcarp</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 24 Mar 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="/categories/machine-learning/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>ML Hyperpolyglot</title>
      <link>/posts/2026/ml-hyperpolyglot/</link>
      <pubDate>Tue, 24 Mar 2026 00:00:00 +0000</pubDate>
      <guid>/posts/2026/ml-hyperpolyglot/</guid>
      <description>&lt;p&gt;In the course of my work I found myself looking up the specs of various TPUs and GPUs quite frequently.&#xA;There wasn&amp;rsquo;t a good resource that combined the two in a common table with all the relevant stats, so I made one.&#xA;It may not be useful to anyone else, but I&amp;rsquo;ve been using it at least once a day.&#xA;&lt;a href=&#34;https://jeffcarp.github.io/ml-hyperpolyglot/accelerators.html&#34;&gt;Check it out here&lt;/a&gt; and let me know if you find it useful. :)&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Debugging Journey into XLA, TPUs, and JAX</title>
      <link>/posts/2026/debugging-xla-tpus-jax/</link>
      <pubDate>Mon, 23 Feb 2026 00:00:00 +0000</pubDate>
      <guid>/posts/2026/debugging-xla-tpus-jax/</guid>
      <description>&lt;p&gt;I published an account of an interesting* &lt;a href=&#34;https://jeffcarp.substack.com/p/a-debugging-journey-into-xla-tpus&#34;&gt;yak shaving&#xA;journey&lt;/a&gt; I&#xA;went on to debug a custom Pallas kernel on TPU. I&amp;rsquo;ll probably inline the&#xA;content here at some point.&lt;/p&gt;&#xA;&lt;p&gt;*Maybe to me and two other people on Earth&lt;/p&gt;</description>
    </item>
    <item>
      <title>Helpful Mindset Shifts for GPU Users Looking at TPUs</title>
      <link>/posts/2026/tpus-for-gpu-users/</link>
      <pubDate>Thu, 29 Jan 2026 00:00:00 +0000</pubDate>
      <guid>/posts/2026/tpus-for-gpu-users/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Disclaimer: The views and opinions expressed in this post are my own and do&#xA;not necessarily reflect the official policy or position of my employer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;As someone who&amp;rsquo;s worked with TPUs for a while, I&amp;rsquo;ve seen a common pattern in&#xA;people coming from the GPU world: they&amp;rsquo;ll take a look at a TPU chip&amp;rsquo;s specs,&#xA;then look at a comparable GPU, and see numbers for the GPU chip that are&#xA;obviously higher and scratch their head. Let&amp;rsquo;s look at TPU v5p (the&#xA;training-optimized chip released in 2023) compared to the Nvidia H200 (the&#xA;flagship AI GPU also released in 2023):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Notes from Adaline Applied at AGI House</title>
      <link>/posts/2025/agi-house-notes/</link>
      <pubDate>Wed, 11 Jun 2025 00:00:00 +0000</pubDate>
      <guid>/posts/2025/agi-house-notes/</guid>
      <description>&lt;p&gt;Last week I attended an AI product summit at the beautiful AGI House on the&#xA;peninsula. It was a fun day getting exposed to what&amp;rsquo;s going on the frontier of&#xA;product and AI. Here are my semi-structured notes.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2025/IMG_5190.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/images/2025/IMG_5192.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The thorniest issue in tool use is identity and authentication&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Authentication bugs are much worse with agents because they can move&#xA;faster (e.g. in 15 minutes an agent can exfiltrate a lot more data than a&#xA;human).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Memory for LLMS will become more critical. MCP-based memory will enable&#xA;portability across providers.&lt;/li&gt;&#xA;&lt;li&gt;Tool descriptions are important, treat them like system prompts. An example&#xA;of a great tool description is &lt;a href=&#34;https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking&#34;&gt;sequential&#xA;thinking&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Current models fall apart above 5 loaded tools&lt;/li&gt;&#xA;&lt;li&gt;Current pattern is to delegate tasks to a sub-agent that’s very well tested&#xA;against the specific inputs/outputs&lt;/li&gt;&#xA;&lt;li&gt;MoE points to further specialization in agent space&lt;/li&gt;&#xA;&lt;li&gt;&amp;ldquo;I&amp;rsquo;d rather have an agent that does one thing very well.&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;&amp;ldquo;Tiny teams&amp;rdquo;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Can you have super leverage by harnessing a fleet of agents?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Anthropic&amp;rsquo;s research into how long can a model complete a task correctly?&#xA;Currently O(mins) - next step O(10s of mins)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Proactive agents&lt;/strong&gt; (I thought this was super compelling)&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Background thread monitoring your life, chimes in when it can be useful.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;There are two types of challenges in AI product right now: ones that will&#xA;become solved as ai gets smarter, and those that will stay hard&lt;/li&gt;&#xA;&lt;li&gt;Meme: every tool came from the abuse of context&lt;/li&gt;&#xA;&lt;li&gt;Different software prioritizes different things, like being able to iterate&#xA;quickly, or better reasoning around the whole system&lt;/li&gt;&#xA;&lt;li&gt;Focus on where the handoff points are between humans and AI&lt;/li&gt;&#xA;&lt;li&gt;OpenAI is about to launch a platform with value exchange, same as FB did with&#xA;their dev platform, which they opened up then two years later rolled back and&#xA;slurped up the popular use cases into their platform - Brian Balfour&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The game is to join it, get the distribution, then get off it and take&#xA;your users with you ASAP&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Brand is associated with a person at the company having an opinion in public in a specific space&#xA;&lt;ul&gt;&#xA;&lt;li&gt;So: be out there and be visible in voicing your opinions as a thought leader and maybe iconoclast in a space&lt;/li&gt;&#xA;&lt;li&gt;It helps customers narrow down if their personality matches the brand&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Communication is lossy - holding the entire product in one persons head is super valuable&lt;/li&gt;&#xA;&lt;li&gt;User complaints don&amp;rsquo;t necessarily mean they&amp;rsquo;re switching&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Focus on what is the users &amp;ldquo;hell yes&amp;rdquo; case study&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;VCs are starting to focus on &amp;ldquo;quality of revenue&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;You can build a moat with your good taste&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Being opinionated is a plus for founders&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;cool-tools-mentioned&#34;&gt;Cool tools mentioned&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://opentools.com&#34;&gt;https://opentools.com&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://modelcontextprotocol.io/&#34;&gt;https://modelcontextprotocol.io/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.ragie.ai/&#34;&gt;https://www.ragie.ai/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://poe.com/&#34;&gt;Poe&lt;/a&gt; for &amp;lsquo;subscription fatigue&amp;rsquo; :)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://thesephist.com/posts/tools/&#34;&gt;https://thesephist.com/posts/tools/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://corecursive.com/024-software-as-a-reflection-of-values-with-bryan-cantrill/&#34;&gt;https://corecursive.com/024-software-as-a-reflection-of-values-with-bryan-cantrill/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.granola.ai&#34;&gt;https://www.granola.ai&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://decagon.ai/product/overview&#34;&gt;https://decagon.ai/product/overview&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>How to Fake Multiple CPUs in JAX</title>
      <link>/posts/2025/fake-multiple-cpus-jax/</link>
      <pubDate>Thu, 13 Mar 2025 00:00:00 +0000</pubDate>
      <guid>/posts/2025/fake-multiple-cpus-jax/</guid>
      <description>&lt;p&gt;Here&amp;rsquo;s how to emulate multiple CPUs when running JAX. This makes it easy to&#xA;test multi-TPU/GPU code without actually needing the accelerators.&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;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; os&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;os&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;environ[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;XLA_FLAGS&amp;#39;&lt;/span&gt;] &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    os&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;environ&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;get(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;XLA_FLAGS&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;#39;&lt;/span&gt;) &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34; --xla_force_host_platform_device_count=8&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; jax&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;jax&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;devices()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[CpuDevice(id=0),&#xA; CpuDevice(id=1),&#xA; CpuDevice(id=2),&#xA; CpuDevice(id=3),&#xA; CpuDevice(id=4),&#xA; CpuDevice(id=5),&#xA; CpuDevice(id=6),&#xA; CpuDevice(id=7)]&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Doing Post-Quantum Cryptography in JAX</title>
      <link>/posts/2025/post-quantum-cryptography-jax/</link>
      <pubDate>Sun, 05 Jan 2025 00:00:00 +0000</pubDate>
      <guid>/posts/2025/post-quantum-cryptography-jax/</guid>
      <description>&lt;p&gt;In 2018 while studying ML and&#xA;&lt;a href=&#34;/posts/2018/cs255-cryptography&#34;&gt;cryptography&lt;/a&gt;&#xA;around the same time, I realized that many cryptographic algorithms can be&#xA;expressed as computation graphs, the same ones supported by major ML&#xA;frameworks, which led to a completely frivolous attempt to &lt;a href=&#34;/posts/2018/cryptography-in-tensorflow/&#34;&gt;implement&#xA;cryptographic algorithms in&#xA;TensorFlow&lt;/a&gt;, just to see if it would&#xA;work.&lt;/p&gt;&#xA;&lt;p&gt;The world has changed a lot since 2018. JAX is growing in popularity as an ML&#xA;framework, and in the cryptography space, post-quantum cryptography has gone&#xA;from a mostly theoretical threat to a &lt;a href=&#34;https://www.infoq.com/news/2024/12/google-willow-quantum-supremacy/&#34;&gt;slightly more real&#xA;one&lt;/a&gt;. So&#xA;continuing the motivation of the original post, I decided to look into&#xA;implementing a post-quantum cryptography algorithm in JAX.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How I’m Learning JAX</title>
      <link>/posts/2024/learning-jax/</link>
      <pubDate>Fri, 13 Dec 2024 00:00:00 +0000</pubDate>
      <guid>/posts/2024/learning-jax/</guid>
      <description>&lt;p&gt;Recently I’ve been trying to learn more about JAX, the next-gen ML framework&#xA;from DeepMind. These are the resources I&amp;rsquo;ve found most helpful so far.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;a href=&#34;https://jax.readthedocs.io/en/latest/user_guides.html#user-guides&#34;&gt;JAX docs&lt;/a&gt;, which are excellent&lt;/li&gt;&#xA;&lt;li&gt;Patrick Kidger’s &lt;a href=&#34;https://kidger.site/thoughts/torch2jax/&#34;&gt;Learning JAX as a PyTorch developer&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;JAX AI Stack &lt;a href=&#34;https://docs.jaxstack.ai/en/latest/tutorials.html&#34;&gt;tutorials&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;The book &lt;a href=&#34;https://www.manning.com/books/deep-learning-with-jax&#34;&gt;JAX in Action&lt;/a&gt;, along with accompanying &lt;a href=&#34;https://github.com/che-shr-cat/JAX-in-Action&#34;&gt;Python notebooks&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Codebases: &lt;a href=&#34;https://github.com/google-deepmind/gemma&#34;&gt;Gemma&lt;/a&gt;, &lt;a href=&#34;https://github.com/AI-Hypercomputer/maxtext/&#34;&gt;MaxText&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://jax-ml.github.io/scaling-book/&#34;&gt;How to Scale Your Model&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;If you know any more good pointers please let me know.&lt;/p&gt;</description>
    </item>
    <item>
      <title>用20行Python构建Markov Chain语句生成器</title>
      <link>/posts/2020/markov-chain-python-zh/</link>
      <pubDate>Sat, 04 Jul 2020 10:44:41 -0800</pubDate>
      <guid>/posts/2020/markov-chain-python-zh/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;A bot who can write a long letter with ease, cannot write ill.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;small&gt;&lt;em&gt;—Jane Austen, Pride and Prejudice&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;&#xA;&lt;p&gt;这篇文章将引导您逐步学习如何使用Python从头开始编写马尔可夫链(&lt;a href=&#34;https://en.wikipedia.org/wiki/Markov_chain&#34;&gt;Markov&#xA;Chain&lt;/a&gt;)，以生成好像一个真实的人写的英语的全新句子。&#xA;简·奥斯丁的《傲慢与偏见》(&lt;a href=&#34;https://www.goodreads.com/book/show/1885.Pride_and_Prejudice&#34;&gt;Pride and Prejudice by Jane&#xA;Austen&lt;/a&gt;)&#xA;是我们用来构建马尔可夫链的文字。&#xA;&lt;a href=&#34;https://colab.research.google.com/drive/14KjFfYEVhFl3nyuGZtFi1vnv5hN88Qn2&#34;&gt;Colab&lt;/a&gt;&#xA;上有一篇可运行的笔记本版本。&lt;/p&gt;&#xA;&lt;p class=&#34;aside&#34;&gt;&#xA;Read&#xA;&lt;a href=&#34;/posts/2019/markov-chain-python/&#34;&gt;the English version of this post here&lt;/a&gt;.&#xA;&lt;/p&gt;&#xA;&lt;h2 id=&#34;setup&#34;&gt;Setup&lt;/h2&gt;&#xA;&lt;p&gt;首先下载“傲慢与偏见”的全文。&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;&lt;span style=&#34;color:#75715e&#34;&gt;# 下载Pride and Prejudice和并切断头.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;!&lt;/span&gt;curl https:&lt;span style=&#34;color:#f92672&#34;&gt;//&lt;/span&gt;www&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;gutenberg&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;org&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;files&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1342&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1342&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;0.&lt;/span&gt;txt &lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt; tail &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;n&lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;32&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;content&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;pride&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;and&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;prejudice&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;txt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# 预览文件.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;!&lt;/span&gt;head &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;n &lt;span style=&#34;color:#ae81ff&#34;&gt;10&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;content&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;pride&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;and&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;prejudice&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;txt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current&#xA;                                 Dload  Upload   Total   Spent    Left  Speed&#xA;100  707k  100  707k    0     0  1132k      0 --:--:-- --:--:-- --:--:-- 1130k&#xA;PRIDE AND PREJUDICE&#xA;&#xA;By Jane Austen&#xA;&#xA;&#xA;&#xA;Chapter 1&#xA;&#xA;&#xA;It is a truth universally acknowledged, that a single man in possession&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;添加一些必要的导入。&lt;/p&gt;</description>
    </item>
    <item>
      <title>I&#39;m Joining Waymo</title>
      <link>/posts/2019/im-joining-waymo/</link>
      <pubDate>Sun, 10 Nov 2019 15:38:38 -0800</pubDate>
      <guid>/posts/2019/im-joining-waymo/</guid>
      <description>&lt;p&gt;Quick life update: I&amp;rsquo;ve left the Chrome team and joined Waymo (formerly the&#xA;Google self-driving car project). I&amp;rsquo;ll be working on ML infrastructure.&lt;/p&gt;&#xA;&lt;p&gt;It was a fantastic whirlwind 3 years working on infrastructure for Chromium and&#xA;helping to&amp;ndash;in a very small way&amp;ndash;push the open web forward. On the team I&#xA;launched &lt;a href=&#34;https://wpt.fyi/&#34;&gt;wpt.fyi&lt;/a&gt;, a resource to help align the APIs of all&#xA;browsers.  I worked on syncing source code across repos. I launched a couple&#xA;TensorFlow ML models. And I helped make the bug tracker quicker and more useful&#xA;for everyone in the project.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How are Words Represented in Machine Learning?</title>
      <link>/posts/2019/how-are-words-represented-in-machine-learning/</link>
      <pubDate>Sat, 13 Jul 2019 01:31:29 +0000</pubDate>
      <guid>/posts/2019/how-are-words-represented-in-machine-learning/</guid>
      <description>&lt;p class=&#34;aside&#34;&gt;&#xA;    &lt;b&gt;Note:&lt;/b&gt;This post had a good run, but it is now very out of date.&#xA;    Check out newer content around &lt;a href=&#34;https://huggingface.co/learn/llm-course/en/chapter2/4&#34;&gt;tokenizers&lt;/a&gt;&#xA;    for a more up-to-date view.&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Machine learning on human languages is a super exciting space right now.&#xA;Applications are exploding&amp;mdash;just think of how many natural language ML models&#xA;it takes to run a smart assistant, from transforming spoken audio to text,&#xA;to finding the exact part of a web page that answers your question, to choosing&#xA;the correct words with the correct grammar to reply to you.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Build a Markov Chain Sentence Generator in 20 lines of Python</title>
      <link>/posts/2019/markov-chain-python/</link>
      <pubDate>Wed, 16 Jan 2019 10:44:41 -0800</pubDate>
      <guid>/posts/2019/markov-chain-python/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;A bot who can write a long letter with ease, cannot write ill.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;small&gt;&lt;em&gt;—Jane Austen, Pride and Prejudice&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;&#xA;&lt;p&gt;This post walks you through how to write a &lt;a href=&#34;https://en.wikipedia.org/wiki/Markov_chain&#34;&gt;Markov&#xA;Chain&lt;/a&gt; from scratch with Python in&#xA;order to generate completely new sentences that resemble English.&lt;/p&gt;&#xA;&lt;p&gt;The text we&amp;rsquo;ll be using to build the Markov Chain is &lt;a href=&#34;https://www.goodreads.com/book/show/1885.Pride_and_Prejudice&#34;&gt;Pride and Prejudice by&#xA;Jane Austen&lt;/a&gt;. You&#xA;can follow along here or grab a runnable notebook version of this post on&#xA;&lt;a href=&#34;https://colab.research.google.com/drive/14KjFfYEVhFl3nyuGZtFi1vnv5hN88Qn2&#34;&gt;Colab&lt;/a&gt;.&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>
