<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Writing-Projects on The Edge Cases</title>
    <link>https://www.kylestratis.com/tags/writing-projects/</link>
    <description>Recent content in Writing-Projects on The Edge Cases</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>© 2025</copyright>
    <lastBuildDate>Fri, 18 Sep 2026 22:38:55 -0400</lastBuildDate>
    <atom:link href="https://www.kylestratis.com/tags/writing-projects/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>TypedDicts in Python</title>
      <link>https://www.kylestratis.com/notes/typeddicts-in-python/</link>
      <pubDate>Thu, 13 Jan 2022 17:11:28 +0000</pubDate>
      <guid>https://www.kylestratis.com/notes/typeddicts-in-python/</guid>
      <description>&lt;p&gt;In Python 3.8+, you can create a dictionary with type annotations with the TypedDict class in the typing module. This is a regular dictionary that allows you to define it with type hints, allowing for better documentation of simple objects like dictionaries. To use them, create a class that inherits from &lt;code&gt;typing.TypedDict&lt;/code&gt; and define your expected keys and their types like so:&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;&#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;from&lt;/span&gt; typing &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; TypedDict&#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:#66d9ef&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;ModelMetadata&lt;/span&gt;(TypedDict):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    audience_id: str&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    training_correlation: List[float]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    validation_correlation: List[float]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    final_sample_count: int&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    final_accounts: List[AccountMetadata]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Setting Pynamo Model&#39;s Table After Instantiation</title>
      <link>https://www.kylestratis.com/notes/setting-pynamo-models-table-after-instantiation/</link>
      <pubDate>Mon, 22 Nov 2021 03:35:57 +0000</pubDate>
      <guid>https://www.kylestratis.com/notes/setting-pynamo-models-table-after-instantiation/</guid>
      <description>&lt;p&gt;In some cases you may not know the table for a Pynamo model until you instantiate it. You can&amp;rsquo;t do this when you construct the object, but you can create a static method that takes the model class and table name and sets &lt;code&gt;model.Meta.table_name&lt;/code&gt; to the &lt;code&gt;table_name&lt;/code&gt; parameter, changing the table that model is connected to. This is useful if you set up models in one module and then import it elsewhere, and the table names come from user input.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Input and Output Channels for Sagemaker Training Jobs</title>
      <link>https://www.kylestratis.com/notes/input-and-output-channels-for-sagemaker-training-jobs/</link>
      <pubDate>Wed, 27 Oct 2021 19:08:01 +0000</pubDate>
      <guid>https://www.kylestratis.com/notes/input-and-output-channels-for-sagemaker-training-jobs/</guid>
      <description>&lt;h2 id=&#34;inputs&#34;&gt;Inputs&lt;/h2&gt;&#xA;&lt;p&gt;With SageMaker training jobs, you specify an &amp;ldquo;input channel&amp;rdquo; and configure it in the job definition. Each channel is a dictionary that specifies the data split. Each of these items will be made available on the instance in &lt;code&gt;/opt/ml/input/data/&amp;lt;stage&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;json-example&#34;&gt;JSON Example&lt;/h3&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;&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&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;&amp;#34;train&amp;#34;&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;&amp;#34;ContentType&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;trainingContentType&amp;#34;&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;&amp;#34;TrainingInputMode&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;File&amp;#34;&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;&amp;#34;S3DistributionType&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;FullyReplicated&amp;#34;&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;&amp;#34;RecordWrapperType&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;None&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; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;evaluation&amp;#34;&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;&amp;#34;ContentType&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;evalContentType&amp;#34;&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;&amp;#34;TrainingInputMode&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;File&amp;#34;&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;&amp;#34;S3DistributionType&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;FullyReplicated&amp;#34;&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;&amp;#34;RecordWrapperType&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;None&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; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;validation&amp;#34;&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;&amp;#34;TrainingInputMode&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;File&amp;#34;&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;&amp;#34;S3DistributionType&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;FullyReplicated&amp;#34;&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;&amp;#34;RecordWrapperType&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;None&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;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;cdk-example&#34;&gt;CDK Example&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-training-algo-running-container.html&#34;&gt;Source&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;outputs&#34;&gt;Outputs&lt;/h2&gt;&#xA;&lt;p&gt;With SageMaker training jobs, model artifacts should be saved to &lt;code&gt;/opt/ml/model/&lt;/code&gt; so that, with the training job output configuration, they will be zipped and added to S3. Failures can be written to the file &lt;code&gt;/opt/ml/output/failure&lt;/code&gt; and the first 1024 characters will be returned as &lt;code&gt;FailureReason&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
