<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>embeddings-from-first-principles examples on Programmer.ie: Modern AI programming</title>
		<link>http://programmer.ie/examples/embeddings-from-first-principles/</link>
		<description>Recent content in embeddings-from-first-principles examples on Programmer.ie: Modern AI programming</description>
		<generator>Hugo</generator>
		<language>en-US</language>
		
		
		
		
			<atom:link href="http://programmer.ie/examples/embeddings-from-first-principles/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>The same cosine means two different things in two spaces</title>
				<link>http://programmer.ie/examples/embeddings-from-first-principles/05-chapter/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>http://programmer.ie/examples/embeddings-from-first-principles/05-chapter/</guid>
				<description>&lt;p&gt;A cosine of 0.4 is a number. What it &lt;em&gt;means&lt;/em&gt; depends on the space it was&#xA;measured in, and the chapter&amp;rsquo;s claim is that you cannot read a cosine without&#xA;the geometry of the space it came from. The benchmark here makes that&#xA;concrete with three seeded spaces that differ in nothing but their shape.&lt;/p&gt;&#xA;&lt;h2 id=&#34;run-it&#34;&gt;Run it&lt;/h2&gt;&#xA;&lt;div class=&#34;bookkit-example-code&#34; data-example-code&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-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git clone https://github.com/ernanhughes/relate.git&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd relate&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git checkout 1de8c95b3995791042d6eb1c150c64c7cdb3492f&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;python -m venv venv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;venv/Scripts/pip install -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;.[dev]&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;venv/Scripts/python benchmarks/geometry/run.py --check&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;  &lt;textarea data-example-source hidden readonly aria-hidden=&#34;true&#34; aria-label=&#34;Code source&#34;&gt;git clone https://github.com/ernanhughes/relate.git&#xA;cd relate&#xA;git checkout 1de8c95b3995791042d6eb1c150c64c7cdb3492f&#xA;python -m venv venv&#xA;venv/Scripts/pip install -e &amp;#34;.[dev]&amp;#34;&#xA;venv/Scripts/python benchmarks/geometry/run.py --check&lt;/textarea&gt;&#xA;  &lt;button type=&#34;button&#34; data-example-copy hidden&gt;Copy code&lt;/button&gt;&lt;span role=&#34;status&#34;&gt;&lt;/span&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&lt;code&gt;--check&lt;/code&gt; is the important flag: it verifies the run reproduces the frozen&#xA;artifacts byte-for-byte instead of overwriting them. Python 3.10 or later,&#xA;NumPy only, no model download, no network.&lt;/p&gt;</description>
			</item>
			<item>
				<title>The nearest neighbour can be wrong, and a readout can be right</title>
				<link>http://programmer.ie/examples/embeddings-from-first-principles/10-chapter/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>http://programmer.ie/examples/embeddings-from-first-principles/10-chapter/</guid>
				<description>&lt;p&gt;The nearest neighbour is a guess made with a metric that was never asked what&#xA;the relation was. The chapter&amp;rsquo;s claim is that a &lt;em&gt;supervised readout&lt;/em&gt; over the&#xA;same vectors finds the relation the metric is blind to, and that a benchmark&#xA;which mines its negatives adversarially is the honest way to see the gap.&lt;/p&gt;&#xA;&lt;h2 id=&#34;run-it&#34;&gt;Run it&lt;/h2&gt;&#xA;&lt;div class=&#34;bookkit-example-code&#34; data-example-code&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-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git clone https://github.com/ernanhughes/relate.git&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd relate&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git checkout 1de8c95b3995791042d6eb1c150c64c7cdb3492f&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;python -m venv venv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;venv/Scripts/pip install -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;.[dev]&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;venv/Scripts/python benchmarks/hard-negatives/run.py --check&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;  &lt;textarea data-example-source hidden readonly aria-hidden=&#34;true&#34; aria-label=&#34;Code source&#34;&gt;git clone https://github.com/ernanhughes/relate.git&#xA;cd relate&#xA;git checkout 1de8c95b3995791042d6eb1c150c64c7cdb3492f&#xA;python -m venv venv&#xA;venv/Scripts/pip install -e &amp;#34;.[dev]&amp;#34;&#xA;venv/Scripts/python benchmarks/hard-negatives/run.py --check&lt;/textarea&gt;&#xA;  &lt;button type=&#34;button&#34; data-example-copy hidden&gt;Copy code&lt;/button&gt;&lt;span role=&#34;status&#34;&gt;&lt;/span&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&lt;code&gt;--check&lt;/code&gt; verifies the frozen artifacts instead of overwriting them. Python&#xA;3.10 or later. No model download, no network.&lt;/p&gt;</description>
			</item>
			<item>
				<title>A threshold calibrated on one domain does not transfer to another</title>
				<link>http://programmer.ie/examples/embeddings-from-first-principles/14-chapter/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>http://programmer.ie/examples/embeddings-from-first-principles/14-chapter/</guid>
				<description>&lt;p&gt;A threshold is a number, and the chapter&amp;rsquo;s claim is that a number is only&#xA;meaningful next to the distribution it was chosen on. The benchmark here&#xA;calibrates on two domains and then reports what a &lt;em&gt;staleness&lt;/em&gt; check notices&#xA;when the inputs move.&lt;/p&gt;&#xA;&lt;h2 id=&#34;run-it&#34;&gt;Run it&lt;/h2&gt;&#xA;&lt;div class=&#34;bookkit-example-code&#34; data-example-code&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-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git clone https://github.com/ernanhughes/relate.git&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd relate&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git checkout 1de8c95b3995791042d6eb1c150c64c7cdb3492f&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;python -m venv venv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;venv/Scripts/pip install -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;.[dev]&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;venv/Scripts/python benchmarks/calibration/run.py --check&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;  &lt;textarea data-example-source hidden readonly aria-hidden=&#34;true&#34; aria-label=&#34;Code source&#34;&gt;git clone https://github.com/ernanhughes/relate.git&#xA;cd relate&#xA;git checkout 1de8c95b3995791042d6eb1c150c64c7cdb3492f&#xA;python -m venv venv&#xA;venv/Scripts/pip install -e &amp;#34;.[dev]&amp;#34;&#xA;venv/Scripts/python benchmarks/calibration/run.py --check&lt;/textarea&gt;&#xA;  &lt;button type=&#34;button&#34; data-example-copy hidden&gt;Copy code&lt;/button&gt;&lt;span role=&#34;status&#34;&gt;&lt;/span&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&lt;code&gt;--check&lt;/code&gt; verifies the frozen artifacts instead of overwriting them. Python&#xA;3.10 or later, NumPy only, no model download, no network.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Turn a delta into an operator, and measure what it costs</title>
				<link>http://programmer.ie/examples/embeddings-from-first-principles/25-chapter/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>http://programmer.ie/examples/embeddings-from-first-principles/25-chapter/</guid>
				<description>&lt;p&gt;A delta between two embeddings is not a transformation. The chapter&amp;rsquo;s claim is&#xA;that to &lt;em&gt;act&lt;/em&gt; on a difference you need an operator, and that choosing one is a&#xA;decision with a measurable cost. The benchmark here fits four candidate&#xA;operators per transformation class and records which one was selected and what&#xA;each scored.&lt;/p&gt;&#xA;&lt;h2 id=&#34;run-it&#34;&gt;Run it&lt;/h2&gt;&#xA;&lt;div class=&#34;bookkit-example-code&#34; data-example-code&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-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git clone https://github.com/ernanhughes/relate.git&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd relate&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git checkout 1de8c95b3995791042d6eb1c150c64c7cdb3492f&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;python -m venv venv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;venv/Scripts/pip install -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;.[dev]&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;venv/Scripts/python benchmarks/operators/run.py --check&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;  &lt;textarea data-example-source hidden readonly aria-hidden=&#34;true&#34; aria-label=&#34;Code source&#34;&gt;git clone https://github.com/ernanhughes/relate.git&#xA;cd relate&#xA;git checkout 1de8c95b3995791042d6eb1c150c64c7cdb3492f&#xA;python -m venv venv&#xA;venv/Scripts/pip install -e &amp;#34;.[dev]&amp;#34;&#xA;venv/Scripts/python benchmarks/operators/run.py --check&lt;/textarea&gt;&#xA;  &lt;button type=&#34;button&#34; data-example-copy hidden&gt;Copy code&lt;/button&gt;&lt;span role=&#34;status&#34;&gt;&lt;/span&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&lt;code&gt;--check&lt;/code&gt; verifies the frozen artifacts instead of overwriting them. Python&#xA;3.10 or later, NumPy only, no model download, no network.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Walk the whole embedding runtime in one command</title>
				<link>http://programmer.ie/examples/embeddings-from-first-principles/26-chapter/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>http://programmer.ie/examples/embeddings-from-first-principles/26-chapter/</guid>
				<description>&lt;p&gt;The last chapter of the book assembles a runtime rather than a claim. This&#xA;command walks the whole path: it registers two spaces, compares them natively,&#xA;fits a bridge, derives a third space, judges the derivation, compresses it,&#xA;applies an operator and explains the lineage.&lt;/p&gt;&#xA;&lt;h2 id=&#34;run-it&#34;&gt;Run it&lt;/h2&gt;&#xA;&lt;div class=&#34;bookkit-example-code&#34; data-example-code&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-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git clone https://github.com/ernanhughes/relate.git&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd relate&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git checkout 1de8c95b3995791042d6eb1c150c64c7cdb3492f&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;python -m venv venv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;venv/Scripts/pip install -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;.[dev]&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;venv/Scripts/python -m relate.cli demo&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;  &lt;textarea data-example-source hidden readonly aria-hidden=&#34;true&#34; aria-label=&#34;Code source&#34;&gt;git clone https://github.com/ernanhughes/relate.git&#xA;cd relate&#xA;git checkout 1de8c95b3995791042d6eb1c150c64c7cdb3492f&#xA;python -m venv venv&#xA;venv/Scripts/pip install -e &amp;#34;.[dev]&amp;#34;&#xA;venv/Scripts/python -m relate.cli demo&lt;/textarea&gt;&#xA;  &lt;button type=&#34;button&#34; data-example-copy hidden&gt;Copy code&lt;/button&gt;&lt;span role=&#34;status&#34;&gt;&lt;/span&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;Python 3.10 or later, NumPy only. No model download, no network, no service.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
