<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Eric Bezzam on Medium]]></title>
        <description><![CDATA[Stories by Eric Bezzam on Medium]]></description>
        <link>https://medium.com/@bezzam?source=rss-1c7c74e61a34------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DggFm02e4Ji0ySoRg71DEw.jpeg</url>
            <title>Stories by Eric Bezzam on Medium</title>
            <link>https://medium.com/@bezzam?source=rss-1c7c74e61a34------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 17:30:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bezzam/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Reflections on Impact, Popularity, and the Life of Alexander Hamilton]]></title>
            <link>https://medium.com/@bezzam/reflections-on-impact-popularity-and-the-life-of-alexander-hamilton-7e12db8270e0?source=rss-1c7c74e61a34------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e12db8270e0</guid>
            <category><![CDATA[hamilton]]></category>
            <category><![CDATA[american-history]]></category>
            <category><![CDATA[thomas-jefferson]]></category>
            <category><![CDATA[popularity]]></category>
            <category><![CDATA[impact]]></category>
            <dc:creator><![CDATA[Eric Bezzam]]></dc:creator>
            <pubDate>Sun, 24 Aug 2025 19:32:40 GMT</pubDate>
            <atom:updated>2025-11-22T09:29:39.262Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-OfejG9OSuAT0UUL8lqDfQ.jpeg" /><figcaption>Alexander Hamilton portrait (1806) by John Trumbull.</figcaption></figure><p>Impact and popularity are two ways people seek meaning in life, but they are not the same. In our age of instant gratification, a social media post with millions of likes may feel impactful, but is unlikely to be remembered weeks later. Popularity can offer a sense of validation, but it often fades. Impact, on the other hand, transcends the moment, person, or place. The initial idea may be unpopular, despised, and even make enemies. Yet, if it survives the initial resistance, it can reshape society and be so deeply ingrained in our modern lives that society without it (<em>think capitalism, democracy, internet</em>) may seem strange or even impossible, for better or worse. Thomas Paine’s challenge to British aristocracy at the cusp of the American revolution aptly captures this tendency of ours to “just accept things the way they are”:</p><blockquote>A long habit of not thinking a thing wrong, gives it a superficial appearance of being right, and raises at first a formidable outcry in defense of custom. But the tumult soon subsides. Time makes more converts than reason.</blockquote><p>Alexander Hamilton’s life presents a captivating story of the tension between impact and popularity. Hamilton was and remains a divisive figure with ardent supporters (<a href="https://en.wikipedia.org/wiki/Alexander_Hamilton_%28biography%29">Chernow</a> and <a href="https://en.wikipedia.org/wiki/Hamilton_(musical)">Miranda</a>) and harsh critics (<a href="https://www.amazon.com/Hamiltons-Curse-Jeffersons-Revolution-Americans/dp/0307382850">Dilorenzo</a> and <a href="https://www.amazon.com/How-Alexander-Hamilton-Screwed-America/dp/1621576353">McClanahan</a>). He rarely sacrificed his principles for public approval —<em> a stubborn stance that may have contributed to his untimely death</em> — yet his ideas have profoundly shaped the United States for more than two centuries. <strong>From the structure of the federal government and the foundations of American capitalism to the nation’s military and the freedom of the press, Hamilton left his mark on enduring American institutions.</strong></p><h3>The Overlooked One?</h3><p>A standard American education in early 2000s highlighted heroes such as <em>George Washington</em> for leading the Continental Army through the Revolution and becoming the first president, <em>Thomas Jefferson</em> for penning the oft-evoked words that “<a href="https://en.wikipedia.org/wiki/All_men_are_created_equal"><em>all men are created equal</em></a>” and doubling the size of the country (<a href="https://en.wikipedia.org/wiki/Louisiana_Purchase">Louisiana Purchase</a>), <em>Benjamin Franklin</em> for nearly electrocuting himself with a <a href="https://en.wikipedia.org/wiki/Kite_experiment">kite</a>, <em>Paul Revere</em> for warning that “<a href="https://en.wikipedia.org/wiki/Paul_Revere%27s_midnight_ride"><em>the British are coming</em></a>”, and <em>John Hancock</em> for leaving little space for his friends to <a href="https://en.wikipedia.org/wiki/John_Hancock#Signing_the_Declaration">sign</a> the king’s surprise gift card from the thirteen colonies. Hamilton was barely mentioned, though that has perhaps changed after the <a href="https://en.wikipedia.org/wiki/Hamilton_(musical)">2015 musical</a>.</p><p>Nevertheless, historians do recognize Hamilton’s key contributions to American society; <a href="https://archive.org/details/sevenwhoshapedou00morr/page/n371/mode/2up">Richard B. Morris</a> ranked him as one of seven key founders, alongside George Washington, John Adams, Benjamin Franklin, John Jay, Thomas Jefferson, and James Madison, based on leadership, longevity, and statesmanship. Among them, Hamilton stood out: he was the <em>only one born outside the American colonies</em>, arriving from the Caribbean island of Nevis, and he <em>died significantly younger</em> (~35 years earlier than the average) due to his fatal <a href="https://en.wikipedia.org/wiki/Burr%E2%80%93Hamilton_duel">duel with Aaron Burr</a>.</p><h3>Ambitious and Rivalrous Founders</h3><p>In his <a href="https://en.wikipedia.org/wiki/Alexander_Hamilton_(biography)">biography</a> of Hamilton, Ron Chernow credits the Founding Fathers for their contributions in shaping the country, while also unmasking their pettiness, moral inconsistency, and selfish ambition. Chernow clearly leans in Hamilton’s favor, often casting Adams and Jefferson in an unflattering light. Still, his account also reveals Hamilton’s flaws: long-winded, overly sensitive, elitist in his distrust of direct democracy, and quick to take offense. Moreover, Hamilton worked relentlessly, often at the expense of his family, and as his friend Gouverneur Morris <a href="https://founders.archives.gov/documents/Hamilton/01-26-02-0001-0271">noted</a> in his preparation for Hamilton’s eulogy, he could be “indiscreet, vain, and opinionated.”</p><p>The Founders were <strong>impactful</strong> men, but still men, driven by personal ambition and a hunger for glory. United against the British, they splintered in the years that followed, clashing over the balance of state and federal power, foreign policy, and the nation’s finances. In the process, they sidestepped urgent moral issues like slavery under the guise of “compromise.”</p><p>Alexander Hamilton was no stranger to controversy and rivalries, and perhaps even the extreme example of it. He regularly waged press wars, publishing blistering critiques of political opponents, even sitting presidents like John Adams and Thomas Jefferson. It certainly didn’t help Hamilton’s reputation that up until John Quincy Adams (<em>6th president from 1825–1829 and son of 2nd president John Adams</em>), Hamilton found a political rival. His early death in 1804, during Jefferson’s presidency, left him unable to defend himself. Criticism followed him in life and after, not only for his ambition and moral failings but also for irrelevant personal circumstances outside his control (<em>with such attacks unfortunately still common today’s political discourse</em>), such as being born out of wedlock and outside the United States.</p><p>Notably, Hamilton was at the center of America’s first major political <a href="https://en.wikipedia.org/wiki/Hamilton%E2%80%93Reynolds_affair">sex scandal</a>. His opponents attempted to connect this affair with (false) corruption charges. Hamilton responded with a 95-page pamphlet admitting to the affair, in his characteristic (and unnecessary) verbose style. While he could clear his name of corruption, the confession to adultery only deepened the damage, providing endless ammunition for opponents. Though Hamilton sought to place principles above popularity, his candor ultimately backfired. This occurred even as many of his peers had their own moral failings, such as most Founding Fathers owning slaves and Jefferson’s <a href="https://en.wikipedia.org/wiki/Jefferson%E2%80%93Hemings_controversy">relationship with Sally Hemings</a>. Hamilton’s openness may have set a cautionary lesson for later politicians who chose instead to deny scandals, perhaps hoping that lingering doubt would keep public opinion from turning against them.</p><h3>Four Impactful Contributions</h3><p>Despite dying much earlier than his peers and his divisive character, Hamilton made <strong>enduring contributions to American government, finance, law, and military</strong>:</p><ol><li><strong>Leading the publication of </strong><a href="https://en.wikipedia.org/wiki/The_Federalist_Papers"><strong><em>The Federalist Papers</em></strong></a><strong>,</strong> and writing 51 out of the 85 essays for promoting the ratification of the new US Constitution by the state of New York. While the New York vote was ultimately inconsequential (the Constitution was already ratified by the necessary nine of the thirteen states), <em>The Federalist Papers</em> remain a vital source for understanding the intent of one of history’s shortest constitutions. For perspective, the original constitution contains just seven articles totaling around 4,500 words, while <em>The Federalist Papers</em> comprise around 180,000 words (40x more). In the very <a href="https://avalon.law.yale.edu/18th_century/fed01.asp">first essay</a>, Hamilton warned about the “<em>stale bait of popularity at the expense of public good</em>” and of the “<em>dangerous ambition…behind the specious zeal for the right of people [rather] than…the zeal firmness and efficiency of government…[with] the former…a much more certain road to the introduction of despotism than the latter</em>”— a keen observations as relevant to modern politics as they were during the early experiments of democracy.</li><li><strong>Laying the foundations of the country’s financial system</strong> as the <a href="https://en.wikipedia.org/wiki/Alexander_Hamilton#First_U.S._secretary_of_the_treasury_(1789%E2%80%931795)">first Secretary of Treasury</a> (1789–1795). Hamilton addressed the enormous debt left by the Revolutionary War and restored the government’s credibility in borrowing and managing debt (i.e., <a href="https://en.wikipedia.org/wiki/Government_debt">public credit</a>). He proposed consolidating state and national debts, establishing a national bank through investment banking, and repaying government bonds at full value (<em>which meant many speculators profited, rather than war veterans who had sold bonds at a discount out of necessity for cash</em>). These policies angered many, especially the agrarian-based Southern states with less debt, who feared that the financially-oriented Northern states would benefit disproportionately. Through compromise, such as relocating the capital closer to the South (Washington DC), Hamilton advanced his economic agenda, laying the foundation for America’s financial credibility and capitalist economy (<em>but also deferred moral issues like slavery as the South depended on it for their economy</em>). However, his divisive proposals fueled the emergence of two political factions: the <a href="https://en.wikipedia.org/wiki/Federalist_Party">Federalists</a> (with Hamilton as a main figure) who favored a strong central government, and the <a href="https://en.wikipedia.org/wiki/Democratic-Republican_Party">Republicans</a> (led by Jefferson) who promoted states’ rights and opposed Hamilton’s nationalist policies. When Jefferson became president in 1801, he initially sought to dismantle Hamilton’s financial system, but his Secretary of the Treasury (<a href="https://en.wikipedia.org/wiki/Albert_Gallatin">Albert Gallatin</a>) persuaded him otherwise, calling it “<em>the most perfect system ever formed.</em>”</li><li><strong>Advocating for a national army and military academy.</strong> During the Revolutionary War, Hamilton and Washington by the weaknesses of a disorganized and badly-funded militia (Hamilton served as Washington’s chief aide for four years). This motivated Hamilton’s 1800 proposal, titled <em>“A Bill for Establishing a Military Academy”</em> (<a href="https://founders.archives.gov/documents/Hamilton/01-24-02-0057">this letter</a> expresses some of those proposals). However, it <a href="https://founders.archives.gov/documents/Hamilton/01-24-02-0272">stalled</a> amid political rivalries and distrust from his enemies, who viewed him as another power-grabbing Bonaparte. When Jefferson became president shortly after in 1801, despite his reservations about a large national army and a federally-managed academy, he re-introduced the bill to Congress and got the approval (and the credit) through the <a href="https://en.wikipedia.org/wiki/Military_Peace_Establishment_Act">Military Peace Establishment Act</a> in 1802.</li><li><strong>Advancing freedom of the press and establishing truth as a defense in libel cases.</strong> In 1802, Hamilton defended journalist 24 year-old Harry Croswell, who was prosecuted for libel after accusing President Jefferson of unethical conduct (<a href="https://en.wikipedia.org/wiki/People_v._Croswell"><em>People v. Croswell</em></a>). At the time, truth was not a valid defense against libel. Hamilton argued that “<em>the right of giving the truth in evidence…is all-important to the liberties of the people.</em>” Though Croswell lost, Hamilton’s reasoning was soon adopted in New York law and eventually spread nationwide. This legal shift may have been foundational in protecting important investigative journalism in America’s history in the centuries to follow, namely the kind that exposed corporate monopolies (<a href="https://en.wikipedia.org/wiki/The_History_of_the_Standard_Oil_Company"><em>The History of the Standard Oil Company</em></a>), unsafe labor conditions (<a href="https://en.wikipedia.org/wiki/The_Jungle"><em>The Jungle</em></a>), environmental damage (<a href="https://en.wikipedia.org/wiki/Silent_Spring"><em>Silent Spring</em></a>), and government secrecy (<a href="https://en.wikipedia.org/wiki/Pentagon_Papers"><em>Pentagon Papers</em></a>). America’s rich history of impactful investigative journalism leading to reform may not have been possible if reputation trumped truth in the court of law.</li></ol><h3>Defeat Yet Transformative</h3><p>Ironically, in each of these areas, Hamilton faced immediate defeat or failed to achieve his original intention:</p><ol><li><em>The Federalist Papers</em> did not sway New York’s ratification vote.</li><li>His fiscal policies, meant to unite the nation, deepened partisan division.</li><li>His military ambitions were realized by his political enemy Jefferson.</li><li>He lost the Croswell case in court.</li></ol><p>Yet these very initiatives went on to shape America’s government, capitalistic economy, defense, and legal protections for centuries (and influence the rest of the world). By <strong>resisting the pull of public opinion and putting forward bold, often unpopular ideas</strong>, Hamilton’s ideas and institutions have largely shaped modern America. His visionary direction may reflect his own belief that:</p><blockquote>“Wise politicians…march at the head of affairs; insomuch that they ought not to wait the event, to know what measures to take; but the measures which they have taken, ought to produce the event.” (<a href="https://founders.archives.gov/documents/Hamilton/01-01-02-0350">Pay Book of the State Company of Artillery</a>, 1777)</blockquote><p><strong>Jefferson, by contrast, mastered the art of popularity</strong>. While Hamilton dismissed the “<em>stale bait of popularity</em>” and doubted the wisdom of uninformed citizens, Jefferson spoke in lofty, motivational terms on equality (<a href="https://en.wikipedia.org/wiki/All_men_are_created_equal"><em>all men are created equal</em></a>), revolutionary spirit (<a href="https://www.monticello.org/research-education/thomas-jefferson-encyclopedia/tree-liberty-quotation/"><em>the tree of liberty must be refreshed from time to time with the blood of patriots and tyrants</em></a>), and self-government (<a href="https://www.loc.gov/exhibits/jefferson/60.html"><em>wherever the people are well informed they can be trusted with their own government</em></a>). Yet, Jefferson owned slaves, maintained a strong federal government he once opposed, and never fought in the Revolution — in fact, he famously <a href="https://www.loc.gov/item/2021688388/">fled</a> as governor of Virginia. His talent for appealing to the masses, along with memorable one-liners, helped cement his reputation as a broadly admired founder, while Hamilton’s legacy remained polarizing and his contributions under-appreciated.</p><h3>Beyond Impact and Popularity</h3><p>For much of his life, Hamilton’s drive came from a deep need to prove himself — a child born out of wedlock, orphaned young, and often reminded that he was not a “true” American. But toward the end of his life, there was a shift towards family and faith, suggesting he may have found a sense of meaning not necessarily from impact or popularity, but belonging. After being mortally wounded in his duel with Burr, Hamilton spent his last hours surrounded by his seven children and his wife, whom he could lovingly call in his <a href="https://founders.archives.gov/documents/Hamilton/01-26-02-0001-0248">final letter</a> the “best of wives and best of women.”</p><h3>Conclusion</h3><p>Alexander Hamilton’s life is a reminder that impact can outlast a lifetime, even if recognition comes only long after. His vision for a strong central government, a stable financial system, a national defense, and a free press helped define the United States as we know it. Though he lost many political battles in his day, his ideas and contributions have significantly shaped modern America. While debates continue on whether <a href="https://www.history.com/articles/whose-vision-of-america-won-out-hamiltons-or-jeffersons">Hamilton or Jefferson</a> left the greater mark, neither man was perfect, and the country likely benefited from their competing visions. As James Madison, co-author of <em>The Federalist Papers</em> turned political rival of Hamilton, wrote in <a href="https://avalon.law.yale.edu/18th_century/fed51.asp">Federalist No. 51</a>:</p><blockquote><em>“</em>Ambition must be made to counteract ambition… If men were angels, no government would be necessary. If angels were to govern men, neither external nor internal controls on government would be necessary.<em>”</em></blockquote><p>Hamilton and Jefferson were certainly no angels, nor were the politicians who have governed the country since. Nevertheless, through a careful division of powers and a system of checks-and-balances, the longest-running written constitution has proven robust enough to let competing visions continually shape the nation.</p><p>Most of us will never define the trajectory of nations, but Hamilton offers an admirable example of steadfastly holding to one’s principles and advancing bold ideas. His experience also shows that in high-stakes situations (e.g., founding a company or in leadership), impact, strong personalities, and division often go hand in hand — a reminder that shaping the future may require not only vision and courage, but also the willingness to bear the costs that come with them. Yet Hamilton’s final days hint at another truth: that even for those who reshape history, the greatest comfort may be found not in the battles won, but in knowing where we belong.</p><p><em>Note: I’m not a historian, so please take the above analysis with a grain of salt! My sources have been Ron Chernow’s </em><a href="https://en.wikipedia.org/wiki/Alexander_Hamilton_(biography)"><em>Alexander Hamilton</em></a><em> and the linked references throughout. My aim isn’t to deliver a definitive historical account, but to explore human behavior, the roots of modern society, and their consequences today. I hope you found it interesting, and I’d be glad to hear your thoughts.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e12db8270e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Collaborative Coding with GitHub]]></title>
            <link>https://medium.com/@bezzam/collaborative-coding-with-github-70e23d0f26af?source=rss-1c7c74e61a34------2</link>
            <guid isPermaLink="false">https://medium.com/p/70e23d0f26af</guid>
            <category><![CDATA[collaboration]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[Eric Bezzam]]></dc:creator>
            <pubDate>Sat, 09 Mar 2024 11:06:14 GMT</pubDate>
            <atom:updated>2024-03-09T11:06:14.750Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Below you can find an overview of (planned) posts for “</em><strong><em>Collaborative Coding with GitHub</em></strong><em>”, a workshop that I’ve given several times at EPFL (through </em><a href="https://lauzhack.com/"><em>LauzHack</em></a><em>) to help students and researchers familiarize themselves with Git and GitHub. The posts are meant to complement the workshop, whose material (slides and recording) can be found </em><a href="https://drive.google.com/drive/u/1/folders/1LiGhOMKIDdoeuwIwuqWgHs7E0bT5orQ_?usp=drive_link"><em>here</em></a><em>. However, the posts can also be used as a standalone guide. Enjoy!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4dOlAWFsOYX4fdxibIv7DA.png" /></figure><p>Ever send code files by email or text? <strong>Stop this instant 🛑</strong></p><p>Below are a series of (planned) posts that should get you up to speed with Git and GitHub:</p><ol><li>Git vs. GitHub, and why version control?</li><li><a href="https://medium.com/@bezzam/creating-a-github-repository-c425feb345d0">Create</a> and <a href="https://medium.com/@bezzam/four-ways-to-download-a-github-repo-a31496ad5b81">download</a> a GitHub repository OR <a href="https://medium.com/@bezzam/upload-and-link-your-local-project-to-github-87ddf20c30ce">upload your existing project</a> to GitHub.</li><li>Navigating a GitHub repository page.</li><li>Uploading and downloading changes (pushing and pulling).</li><li>Dealing with conflicts.</li><li>Making a pull request and collaborative development.</li><li>Contributing to an open-source project.</li></ol><h3>Additional</h3><ul><li><a href="https://medium.com/@bezzam/adding-an-ssh-key-to-your-github-account-fcf1f9f20579">Add an SSH key to your GitHub account</a>.</li><li>Adding collaborators.</li><li>Changing repository settings.</li><li>To push or not to push?</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70e23d0f26af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hydra for Cleaner Python Code and Better Reproducibility in Research]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@bezzam/hydra-for-cleaner-python-code-and-better-reproducibility-in-research-c035028101f9?source=rss-1c7c74e61a34------2"><img src="https://cdn-images-1.medium.com/max/1200/1*PPpH_Mv7ZuhBBN7C1P_xpg.png" width="1200"></a></p><p class="medium-feed-snippet">This post is a part of a (planned) series on &#x201C;Python Development Tips&#x201D;, a workshop that I&#x2019;ve given several times at EPFL (through&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@bezzam/hydra-for-cleaner-python-code-and-better-reproducibility-in-research-c035028101f9?source=rss-1c7c74e61a34------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@bezzam/hydra-for-cleaner-python-code-and-better-reproducibility-in-research-c035028101f9?source=rss-1c7c74e61a34------2</link>
            <guid isPermaLink="false">https://medium.com/p/c035028101f9</guid>
            <category><![CDATA[python-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[reproducibility]]></category>
            <category><![CDATA[hydra]]></category>
            <category><![CDATA[reproducible-research]]></category>
            <dc:creator><![CDATA[Eric Bezzam]]></dc:creator>
            <pubDate>Wed, 28 Feb 2024 14:20:48 GMT</pubDate>
            <atom:updated>2024-11-07T22:39:27.527Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Organizing an event? Ditch Google Forms, use Luma ]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@bezzam/organizing-an-event-ditch-google-forms-use-luma-451bde77f5a9?source=rss-1c7c74e61a34------2"><img src="https://cdn-images-1.medium.com/max/1280/1*Oav4mRtIp0hxCz2hNiXPaw.jpeg" width="1280"></a></p><p class="medium-feed-snippet">With LauzHack, we&#x2019;ve organized over 50 tech talks and workshops since 2018. We would use Google Forms for our event sign-ups, until 2023&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@bezzam/organizing-an-event-ditch-google-forms-use-luma-451bde77f5a9?source=rss-1c7c74e61a34------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@bezzam/organizing-an-event-ditch-google-forms-use-luma-451bde77f5a9?source=rss-1c7c74e61a34------2</link>
            <guid isPermaLink="false">https://medium.com/p/451bde77f5a9</guid>
            <category><![CDATA[google-forms]]></category>
            <category><![CDATA[organizing-events]]></category>
            <category><![CDATA[luma]]></category>
            <category><![CDATA[event-planning]]></category>
            <dc:creator><![CDATA[Eric Bezzam]]></dc:creator>
            <pubDate>Tue, 13 Feb 2024 08:36:25 GMT</pubDate>
            <atom:updated>2024-11-07T22:45:41.392Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Starting a tech club in your university or community (hackathons, tech talks, etc)]]></title>
            <link>https://medium.com/@bezzam/starting-a-tech-club-in-your-university-or-community-hackathons-tech-talks-etc-11f4ca901b67?source=rss-1c7c74e61a34------2</link>
            <guid isPermaLink="false">https://medium.com/p/11f4ca901b67</guid>
            <category><![CDATA[hackathon-organizing]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[event-planning]]></category>
            <category><![CDATA[university-club]]></category>
            <dc:creator><![CDATA[Eric Bezzam]]></dc:creator>
            <pubDate>Sun, 04 Feb 2024 04:19:47 GMT</pubDate>
            <atom:updated>2024-02-22T10:08:38.968Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://lauzhack.com/"><em>LauzHack</em></a><em> has been organizing tech events for EPFL and European students since 2016. </em><strong><em>In </em></strong><a href="https://go.epfl.ch/lauzhack-howto"><strong><em>this document</em></strong></a><strong><em>, we uncover our planning process for large events at EPFL.</em></strong><em> While that document dives deep into specifics for EPFL, </em><strong><em>this blog post</em></strong><em> shares my experience and insight that may be useful for current (and future) organizers at EPFL and other communities.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ERnVzYTGtrVQqJ0p3drDdA.png" /><figcaption>LauzHack 2017.</figcaption></figure><p>Since 2016, <a href="https://lauzhack.com/">LauzHack</a> has organized <strong>7 in-person hackathons, 2 online hackathons, and 33 tech talk/workshops</strong>. Most of our attendees are students at <a href="https://en.wikipedia.org/wiki/%C3%89cole_Polytechnique_F%C3%A9d%C3%A9rale_de_Lausanne">EPFL</a>, a technical university in Switzerland, but our yearly hackathon also gathers participants from 30+ universities over 10+ countries.</p><p>Our events don’t typically follow a particular theme, with our mission to provide <strong>a space where students can learn, be creative, and build</strong>. In particular, learn and build those things which would be impossible (or rather incompatible) with their courses. Below are the winning projects from each edition:</p><ul><li>2023: <a href="https://devpost.com/software/sightsync">Virtual assistant for the visually-impaired</a> 👨‍🦯</li><li>2023 (sustainability at EPFL): <a href="https://devpost.com/software/secondlife-products-and-materials">Giving items a second life</a> ♻️</li><li>2022: <a href="https://devpost.com/software/nostoi-your-personal-librarian">Information retrieval of course materials with LLMs</a> 🤖</li><li>2020: <a href="https://devpost.com/software/covid-city">Game to simulate the decision of Covid policies in a city</a> 🎮</li><li>2020 (solutions to Covid-19): <a href="https://devpost.com/software/1lettre1sourire-org">Web interface for writing and sending letters to isolated elderly</a> ✍️</li><li>2019: <a href="https://devpost.com/software/augmented-reading">Immersive reading experience through adaptive lighting and sound</a> 📖</li><li>2018: <a href="https://devpost.com/software/lauzhack2018-x85hn3">AR to display live info about industrial machines</a> 🏭</li><li>2017: <a href="https://devpost.com/software/motiondrawing">Using the Mac trackpad as a tablet</a> 🖋️</li><li>2016: <a href="https://devpost.com/software/wshhh">Digitized wardrobe</a> 👚</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7608UZWUQuSRuGaIKinAUA.jpeg" /><figcaption>LauzHack 2023 winners.</figcaption></figure><p>Over the years, we’ve seen trends come and go, but a <strong>constant theme has always been exceptionally curious students</strong> willing to learn and try new things. Coupled with an increasing availability of powerful and versatile technologies, the quality of projects gets better and better each year.</p><p>What’s equally encouraging is to see others in our community embracing hackathons as a means for innovation in the topics they’re passionate about. Over the years, we’ve provided advice and collaborated with the various events/clubs: <a href="https://www.essentialtech.ch/peace-tech-hackathon">PeaceTech hackathon</a>, <a href="https://scala.epfl.ch/">Scala Center</a>, <a href="https://www.s2s.vc/">S2S Ventures</a>, <a href="https://www.epfl.ch/campus/associations/list/qc/">Quantum Computing Association</a>, <a href="https://bsaepfl.ch/hackathon/">Blockchain hackathon</a>, <a href="https://juliaepfl.github.io/Website/">JuliaEPFL</a>, <a href="https://www.dag-epfl.ch/">Data Analytics Group</a>, <a href="https://clic.epfl.ch/commissions/edc">EPFL Developers Club</a>, <a href="https://actu.epfl.ch/news/the-first-openfood-hackathon-at-epfl-is-a-hit/">OpenFood Hackdays</a>.</p><p>When meeting with other organizers and clubs, we share our <a href="https://go.epfl.ch/lauzhack-howto"><strong>hackathon planning document</strong></a><strong> </strong>(largely prepared by <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=&amp;cad=rja&amp;uact=8&amp;ved=2ahUKEwi5y9SDwpCEAxWVHEQIHQIaBQIQFnoECBIQAQ&amp;url=https%3A%2F%2Fsolalpirelli.github.io%2F&amp;usg=AOvVaw1QrYy32lZs2tv6-BCZsUgF&amp;opi=89978449">Solal</a>!), which we hope serves as a useful starting point for others organizing events at EPFL. While it contains many details specific to EPFL, a lot is applicable elsewhere, in particular the tasks for a large event and their timing. Below I try to generalize the main insight from this document and from my experience in starting a club from scratch.</p><h3><strong>Enough promo! here are the tips 👇👇</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1Ac6nLitqf3J0AK76om0w.jpeg" /></figure><h4><strong>🤔 Define yourself</strong></h4><p>People need to know what you’re about, and what they can expect from your event(s). Dream big. The scope will probably narrow as your figure out the logistical details, <em>but can also grow</em> more than you expect. Our focus with LauzHack is beginner-friendly tech events and giving students the shame-free space to learn and try new things. It started with a yearly hackathon in 2016, and in 2018 we started doing tech talks/workshops as a way to give students the confidence and skills for going to hackathons. From March 2023, our workshops became weekly, and now they also serve the purpose of teaching the EPFL community tech skills for their courses, research, and future work-life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oav4mRtIp0hxCz2hNiXPaw.jpeg" /><figcaption>Workshop on Git/GitHub.</figcaption></figure><h4><strong>👥 Make friends</strong></h4><p>A community needs people, and the foundation will be a solid team. LauzHack started because when I was doing my Masters at EPFL: a friend from my Bachelor studies (at Jacobs University) asked if I wanted to organize a hackathon at EPFL. We had both participated in <a href="https://jacobshack.com/">JacobsHack</a> during our Bachelors, but there was no hackathon at EPFL at that time. He convinced me of the need, we went to EPFL’s CS association, convinced more people, put together a solid team, and the rest is history.</p><p>Within that team, it’s helpful to define clear roles: it’s ok if people do multiple things, but each core task should have someone responsible. For example for the LauzHack hackathon, we have (the different color codes in <a href="https://go.epfl.ch/lauzhack-howto">the planning document</a>): (1) company sponsorship, (2) meals and food sponsorship, (3) communications/marketing, (4) swag purchasing, (5) finance, (6) IT, (7) logistics, and (8) judging.</p><p>Choose a digital space when you can share ideas and documents, for example a Google Drive or Notion. <a href="https://www.when2meet.com/">When2meet</a> is great for scheduling meetings with busy people.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zBwjNaz7P8a77drQ5y0uoQ.jpeg" /><figcaption>2017 organizing team.</figcaption></figure><h4><strong>📍 How, what, where, when</strong></h4><p>You have your identity and the team to execute, now what’s your event(s) going to look like? How many people? Do you need to prepare content, or do you know someone who could give that talk? Maybe it already exists <a href="https://lauzhack.com/workshops">online</a>? Reach out early to invited guests (speakers, judges, etc).</p><p>You’ll also need a venue and you’ll probably need money. Both of those will decide how many people you’ll have at your event, and what you can offer in terms of swag and food (you can never go wrong with pizza). Do you know an office space that you can borrow? Or do you know a professor or PhD student who can book a room? At someone’s apartment? It’s ok to start small, and once you get traction and have a track record, it will be easier to convince people to lend a better/bigger space. Based on the first logistics, you’ll probably need to re-visit the dreams from above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5KeAY61Nahac-TRrezMjXw.jpeg" /><figcaption>Hackers during LauzHack 2016.</figcaption></figure><h4><strong>📢 Spread the word</strong></h4><p>With all of the above (identity, team, first logistics), put yourself out there. Put up some posters (<a href="https://www.canva.com/">Canva</a> is super easy to make nice designs), post on social media, ask other associations or your university to post on social media. And with whatever you put out there, there should <strong>always</strong> be a way for people to sign-up. It can be as simple as a Google form. My personal favorite for event sign-ups is <a href="https://lu.ma/">Luma</a> (<strong><em>check out </em></strong><a href="https://medium.com/@bezzam/organizing-an-event-ditch-google-forms-use-luma-451bde77f5a9"><strong><em>this post</em></strong></a><strong><em> for Luma best practices</em></strong>). If you’re interested, the source code for LauzHack’s page can be found <a href="https://github.com/LauzHack/LauzHack.github.io">here</a>. Also, <a href="https://devpost.com/">DevPost</a> is great for having an all-in-one digital space for a hackathon without having to build something from scratch.</p><p>And when you do your events, remember to take pictures and post on social media. Be sure to get consent from your participants (we put a question in the sign-up).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ftQvi3_F-eK4U0vSCVmhjQ.jpeg" /><figcaption>Promotional breakfast about LauzHack.</figcaption></figure><h4><strong>🤝 Sponsors and partners</strong></h4><p>The first one is usually the toughest. You’ve got no track record, how do they know you’ll pull through? You can try partnering with another club that has more experience and an established network. When we were first getting started, LauzHack partnered with <a href="https://mlh.io/">MLH</a>, which (back in the day) got us GitHub as an automatic sponsor, which then reassured potential sponsors we were speaking to.</p><p>Once you have a digital presence, going to job fairs and hackathons is another great way to meet sponsors who are <em>already</em> putting money into events. On LinkedIn, you can look for people that have job titles such as “Campus recruiter” or “Developer/tech evangelist”. As a first sponsorship, just getting them to pay for the pizza/food is already a great step.</p><p>Food and drink sponsors are also great to have. Don’t hesitate to reach out by email/fill out contact forms. Often food/drink companies have samples that they would like to give for free to promote a product. And if you’re frequently ordering from the same pizza/food place, ask if you can do a partnership, where you’ll promote them on social media and in-person for a discount on orders.</p><p><em>You’ll probably reach out to a lot of people, and not get many replies. It’s part of the process. Use a document (or similar) to keep track of who you reached out to and when. Your future club members will thank you.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ARDQUF2UGrkAl_9BZpANZQ.jpeg" /></figure><h4><strong>🔗 Engage your community</strong></h4><p>Use a forum/messaging app like a Telegram/WhatsApp group or a Discord server to build and maintain your community, and so that they can reach out to each other! Avoid paid services like Slack unless you’re sure to continue paying. Coordinate with other local clubs to cross-promote each other’s event so that your community feels like there’s always something interesting. Consistency is important. With other clubs at EPFL, we would create a monthly calendar to promote events across the campus (kudos to the <a href="https://www.linkedin.com/in/anirudhhramesh">Arnie</a> for the design!).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Qwx5B3wY8zOAcSI1_TARQ.jpeg" /><figcaption>Example calendar to cross-promote events on campus.</figcaption></figure><p>That’s enough (for now 😉). It’s not an exhaustive list, but for that check out the <a href="https://go.epfl.ch/lauzhack-howto">planning doc</a>), and if you’re ready to start organzing, <strong>check out </strong><a href="https://medium.com/@bezzam/organizing-an-event-ditch-google-forms-use-luma-451bde77f5a9"><strong>this post</strong></a><strong> on using Luma for managing event sign-ups</strong>. Feel free to comment if you have any questions, or to reach out at lauzhack[at]epfl[dot]ch. Good luck and happy hacking 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lKYaddb8sBm0k4pV5BW3yg.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11f4ca901b67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Upload and link your local project to GitHub]]></title>
            <link>https://medium.com/@bezzam/upload-and-link-your-local-project-to-github-87ddf20c30ce?source=rss-1c7c74e61a34------2</link>
            <guid isPermaLink="false">https://medium.com/p/87ddf20c30ce</guid>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[collaboration-tools]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[upload]]></category>
            <dc:creator><![CDATA[Eric Bezzam]]></dc:creator>
            <pubDate>Mon, 15 Jan 2024 21:27:31 GMT</pubDate>
            <atom:updated>2024-01-15T21:27:31.589Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This post is a part of a (planned) series on “</em><strong><em>Collaborative Coding with GitHub</em></strong><em>”, a workshop that I’ve given several times at EPFL (through </em><a href="https://lauzhack.com/"><em>LauzHack</em></a><em>) to help students and researchers familiarize themselves with Git and GitHub. The posts are meant to complement the workshop, whose material (slides and recording) can be found </em><a href="https://drive.google.com/drive/u/1/folders/1LiGhOMKIDdoeuwIwuqWgHs7E0bT5orQ_?usp=drive_link"><em>here</em></a><em>. However, the posts can also be used as a standalone guide. Enjoy!</em></p><p>Imagine you’ve been working on a coding project that you’re now ready to share with the world! <em>(Or privately with your colleagues/friends.) </em>GitHub is a great place to upload and host that project, to share it with others and to also receive feedback and suggestions.</p><p>In this post, we’ll walk through the process of uploading your “local” project (namely from your computer) to GitHub. Let’s go!</p><p><em>Note that we’ll have to run things from the command line, but we’ll try to be as clear as possible. And </em><em>git should be </em><a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git"><em>installed</em></a><em>.</em></p><h3>🏃 <strong>GTG (Go to GitHub)</strong></h3><p>First thing of course is to log in to <a href="https://github.com/">GitHub</a>. If you don’t have an account, you can create one for free. Once you’re logged in, you should see a page like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xUow6vxPjPULrs9y92-LfA.png" /></figure><p>We’ll go ahead and click on the green “New” button to create a new repo.</p><h3><strong>Initialize your repo settings</strong></h3><p>You’ll now be taken to a page that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*wGr6IoX9VPlCl2lItzlLSg.png" /></figure><p>Here we’ll see one of GitHub’s strengths: an intuitive interface that guides you through the process of creating a repo. Let’s go through each of the fields, and don’t worry if you mess up, you can always change these settings later or start again!</p><h4><strong>Repository name</strong></h4><p>This is the name of your repo. It will be used in the URL of your repo, so it’s best to keep it short and simple. You can use hyphens to separate words, but not spaces. <strong><em>The repository name does not have to match the name of your local folder.</em></strong></p><p>Finally, you can optionally provide a description of your repo. This will only be displayed on the repo’s homepage on GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*NSuPw7kyxXs9EBlSoABjTQ.png" /></figure><h4><strong>Public or private?</strong></h4><p>If you’re alright with everyone seeing your code, feel free to make it public! If it’s a project you want to keep under wraps and just share with collaborators, you can keep it private. You can always change this setting later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*q2zF-lwK5Q6-ImyFeXgyzw.png" /></figure><p>Note that if you create a private repo, it is recommended to have an SSH key set up with your GitHub account (for SSH communication/authentication with GitHub). How to do that is described <a href="https://medium.com/@bezzam/adding-an-ssh-key-to-your-github-account-fcf1f9f20579">here</a>.</p><h4><strong>Initializing your repository with standard files</strong></h4><p>GitHub suggests skipping this step if you’re importing an existing repository. However, if you’re uploading a local project which doesn’t have any Git history, it is fine to do this initialization and in fact <strong>very helpful</strong>! Because you can add files (that GitHub has templates for) that you may not already have in your project but that will be useful for others. If you already have one of these files, don’t add it as it may run into <em>conflicts</em>!</p><ul><li>A README<strong> </strong>file<strong> </strong>will serve as the homepage for the project when people look at it on GitHub, and it’s where you can put useful information about your code.</li><li>.gitignore will tell the git protocol which files to ignore. GitHub has templates for many languages; pick the one for the primary programming language of your project.</li><li>LICENSE tells others how they can use your code. It is <strong>essential</strong> to have one if you share code with others. Check out <a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository">this page</a> for help on picking a license. I recommend picking one now; you can always change it later. If you don’t have a license, the default is that people can’t do anything with your code! <em>(Similarly you should be careful about using code that doesn’t have a license, and contact the author to provide a license!)</em></li></ul><p>After you’ve picked which files you would like to initialize your repo with, go ahead and press the green “Create repository” button. You’ll be taken to your repo’s homepage, which will look something like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AIqHDU0DPCaFnZGEwkTKoA.png" /></figure><h3><strong>Linking your local project to the remote GitHub repo</strong></h3><p>Now we need to make the link between your local project and this newly-created repo on GitHub.</p><p>To that end, the following commands need to be run <strong>from the </strong><a href="https://docs.gitlab.com/ee/gitlab-basics/start-using-git.html#choose-a-termina"><strong>terminal</strong></a><strong> and in the directory of your project</strong>.</p><p>As an example, I will use <a href="https://drive.google.com/file/d/1ycgbkQVD6_9TEhC4GLePnQ1QThfZ0UwB/view">this minimal project</a> (feel free to download and unzip).</p><pre># 1) Initialize a Git repository with a branch called &quot;main&quot;. <br># Make sure to match the branch name on GitHub!<br>git init -b main<br># The above command is for newer versions of Git. <br># If it doesn&#39;t work for you, try running:<br># git init; git checkout -b main<br><br># 2) Link your local folder with the remote repository<br>git remote add origin git@github.com:USERNAME/REPONAME.git<br># In my case, the URL is git@github.com:ebezzam/my-school-project.git</pre><p>You can check that the link between your local folder and the remote repo was made by running:</p><pre>git remote -v<br># you should see something like<br># origin git@github.com:ebezzam/my-school-project.git (fetch)<br># origin git@github.com:ebezzam/my-school-project.git (push)</pre><p>You can now “pull” (git terminology for download) the files from the remote GitHub repo.</p><pre># if necessary, replace &quot;main&quot; with the name of the branch on GitHub<br>git pull origin main</pre><p>If you type ls in the terminal, you can see which files are now in your local folder.</p><p>The following command will show which files are “untracked” (git terminology for files that are not part of the repository):</p><pre>git status</pre><p>Since we haven’t added any files to the remote GitHub repository, all of your project files will probably be untracked. You can track and add files to the remote GitHub repository by running commands like below (for our minimal project):</p><pre>git add python.py                # add file(s) you would like to track<br>git commit -m &quot;Add Python file.&quot; # Message to describe changes/additions<br>git push                         # &quot;push&quot; (upload) files to GitHub</pre><p>In another post, we will explain these commands and show more convenient (and insightful) ways of tracking and uploading files to GitHub, namely with GitHub Desktop and VS code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87ddf20c30ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Four ways to download a GitHub repo]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@bezzam/four-ways-to-download-a-github-repo-a31496ad5b81?source=rss-1c7c74e61a34------2"><img src="https://cdn-images-1.medium.com/max/743/1*pR4rMG3huMu3FpDVGgbokQ.png" width="743"></a></p><p class="medium-feed-snippet">This post is a part of a (planned) series on &#x201C;Collaborative Coding with GitHub&#x201D;, a workshop that I&#x2019;ve given several times at EPFL (through&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@bezzam/four-ways-to-download-a-github-repo-a31496ad5b81?source=rss-1c7c74e61a34------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@bezzam/four-ways-to-download-a-github-repo-a31496ad5b81?source=rss-1c7c74e61a34------2</link>
            <guid isPermaLink="false">https://medium.com/p/a31496ad5b81</guid>
            <category><![CDATA[github-desktop]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[collaboration-tools]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Eric Bezzam]]></dc:creator>
            <pubDate>Mon, 15 Jan 2024 21:00:40 GMT</pubDate>
            <atom:updated>2024-11-07T22:47:17.543Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Adding an SSH key to your GitHub account]]></title>
            <link>https://medium.com/@bezzam/adding-an-ssh-key-to-your-github-account-fcf1f9f20579?source=rss-1c7c74e61a34------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcf1f9f20579</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[Eric Bezzam]]></dc:creator>
            <pubDate>Mon, 15 Jan 2024 20:50:39 GMT</pubDate>
            <atom:updated>2024-01-15T20:50:39.084Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TYkjVKxdCLmx90SG" /><figcaption>Photo by <a href="https://unsplash.com/@jornadaprodutora?utm_source=medium&amp;utm_medium=referral">Jornada Produtora</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><em>Let’s keep this brief as GitHub already provides all the instructions (if you can find it!)</em></p><p><a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key">This page</a> describes how to generate a secret-public key pair, and <a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account">this page</a> describes how to add it to your GitHub account. You can test if it worked by typing ssh -T git@github.com in the <a href="https://docs.gitlab.com/ee/gitlab-basics/start-using-git.html#choose-a-terminal">terminal</a>. If you get the following message:</p><pre>Hi &lt;username&gt;! You&#39;ve successfully authenticated, but GitHub does not provide shell access.</pre><p>You’re good to go!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcf1f9f20579" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a GitHub repository]]></title>
            <link>https://medium.com/@bezzam/creating-a-github-repository-c425feb345d0?source=rss-1c7c74e61a34------2</link>
            <guid isPermaLink="false">https://medium.com/p/c425feb345d0</guid>
            <category><![CDATA[license]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[collaboration-software]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Eric Bezzam]]></dc:creator>
            <pubDate>Sun, 14 Jan 2024 17:49:06 GMT</pubDate>
            <atom:updated>2024-01-15T21:13:30.171Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This post is a part of a (planned) series on “</em><strong><em>Collaborative Coding with GitHub</em></strong><em>”, a workshop that I’ve given several times at EPFL (through </em><a href="https://lauzhack.com/"><em>LauzHack</em></a><em>) to help students and researchers familiarize themselves with Git and GitHub. The posts are meant to complement the workshop, whose material (slides and recording) can be found </em><a href="https://drive.google.com/drive/u/1/folders/1LiGhOMKIDdoeuwIwuqWgHs7E0bT5orQ_?usp=drive_link"><em>here</em></a><em>. However, the posts can also be used as a standalone guide. Enjoy!</em></p><p>In this post, we will walk through the steps of creating a new GitHub repository, or “repo” for short. A repo is another way of saying “project” or “folder”. It is a place where you can store files, such as code, images, and text, and the <a href="https://git-scm.com/">git</a> protocol will keep track of the changes you make to those files. This is called version control.</p><p>Creating a repo on GitHub will create a “remote” repo on GitHub’s servers (as opposed to a “local” version on your computer). You can view a remote repo as a backup or centralized location for your project, which is useful when you’re working on multiple computers, with other people, or if your computers crashes!</p><p>GitHub provides a nice interface for creating and managing repos, with useful features that may not be obvious at first. Let’s look at some of them for creating a repo!</p><h3>🏃 <strong>GTG (Go to GitHub)</strong></h3><p>First thing of course is to log in to <a href="https://github.com/">GitHub</a>. If you don’t have an account, you can create one for free. Once you’re logged in, you should see a page like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xUow6vxPjPULrs9y92-LfA.png" /></figure><p>We’ll go ahead and click on the green “New” button to create a new repo.</p><h3>Initialize your repo settings</h3><p>You’ll now be taken to a page that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*wGr6IoX9VPlCl2lItzlLSg.png" /></figure><p>Here we’ll see one of GitHub’s strengths: an intuitive interface that guides you through the process of creating a repo. Let’s go through each of the fields, and don’t worry if you change your mind, you can always change these settings later!</p><h4><strong>1) Repository name and description</strong></h4><p>This is the name of your repo. It will be used in the URL of your repo, so it’s best to keep it short and simple. You can use hyphens to separate words, but not spaces. For example, if you want to create a repo for your school project, you could name it my-school-project</p><p>And you can optionally provide a description of your repo. This will only be displayed on the repo’s homepage on GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*NSuPw7kyxXs9EBlSoABjTQ.png" /></figure><h4><strong>2) Public or private?</strong></h4><p>“Back in my day”, GitHub only allowed public repos for free, meaning anyone could view the contents of your repo. This was great for open-source projects, but not so great if you wanted to privately work on your code till it was clean and useable enough. GitHub now allows you to have <strong>unlimited</strong> private repos.</p><p>I recommend keeping your repo private until you’re ready to share it with the world. You can always change this setting later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*q2zF-lwK5Q6-ImyFeXgyzw.png" /></figure><h4><strong>3) Initialize with “</strong><a href="https://en.wikipedia.org/wiki/Boilerplate_text"><strong>boilerplate”</strong></a><strong> files</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*L8H3g48nN-XuSt4kkOi1SA.png" /></figure><p>A<strong> README </strong>contains important information about your project (installation, how to use, etc). The file name is typically in all-caps to grab the user’s ATTENTION, as the first thing to look at. On GitHub, the README serves as the homepage for your repo. It will be displayed on the repo’s homepage, and will be the first thing people see when they visit your repo. A common syntax for README files is <a href="https://www.markdownguide.org/basic-syntax/">Markdown</a>, and if you decide to, GitHub will add a README.md file (namely a Markdown file). It’s a good idea to have a README, so I recommend checking this box. You can always delete/change it later, e.g. if you make documentation with <a href="https://www.sphinx-doc.org/en/master/">Sphinx</a> and will need a README.rst file instead of a README.md file as created by GitHub (confused? more on that in another post!).</p><p>A <strong>.gitignore</strong> file is also really useful to have! As the name says, it tells the git protocol to ignore certain files. The templates that GitHub provides are pretty good, so I recommend picking the one for the primary programming language of your project. For example, for Python, it will ignore files that end in .pyc (compiled Python files) and .env (environment variables). You can always add/remove files from the .gitignore file later.</p><p>Finally, for any project, you’ll want to have a <strong>LICENSE </strong>file. This tells people what they can and cannot do with your code. For example, if you want to make your code open source, you can use the MIT license. If you want to make it free for non-commercial use, you can use the Creative Commons license. GitHub provides useful <a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository">info</a> on different ones you can pick from the dropdown. You can always change it later. <strong><em>If you don’t have a license, the default is that people can’t do anything with your code! </em></strong>(Similarly you should be careful about using code that doesn’t have a license, and contact the author to provide a license!)</p><h3><strong>Press the button!</strong></h3><p>And that’s it! Go ahead and press the green “Create repository” button. You’ll be taken to your repo’s homepage, which will look something like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AIqHDU0DPCaFnZGEwkTKoA.png" /></figure><p>Now that you’ve created your repo, you can start adding files to it, and synchronize it with code on your or your friend’s laptop. But first, we need to get this remote repo on our local computer. In the <a href="https://medium.com/@bezzam/four-ways-to-download-a-github-repo-a31496ad5b81">next post</a>, we’ll see different ways of doing that. For now, enjoy your project that does absolutely nothing 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c425feb345d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simulating camera measurements through wave-optics (with PyTorch support!) ]]></title>
            <link>https://medium.com/@bezzam/simulating-camera-measurements-through-wave-optics-with-pytorch-support-faf3fa620789?source=rss-1c7c74e61a34------2</link>
            <guid isPermaLink="false">https://medium.com/p/faf3fa620789</guid>
            <category><![CDATA[optics]]></category>
            <category><![CDATA[simulation]]></category>
            <category><![CDATA[data-augmentation]]></category>
            <category><![CDATA[signal-processing]]></category>
            <category><![CDATA[pytorch]]></category>
            <dc:creator><![CDATA[Eric Bezzam]]></dc:creator>
            <pubDate>Mon, 09 Jan 2023 09:02:41 GMT</pubDate>
            <atom:updated>2023-01-10T13:05:54.124Z</atom:updated>
            <content:encoded><![CDATA[<p><em>As part of recent work on </em><a href="https://arxiv.org/abs/2211.12864"><em>privacy-enhancing classification with lensless cameras</em></a><em>, we needed a large set of data to train and test how different types of cameras would perform on various classification tasks. Ideally, we would record all the data with each camera. However, this approach has two problems:</em></p><ol><li><em>The amount of time required to collect the data.</em></li><li><em>We would have to re-collect all the data if the camera hardware changed (which was the case in our setup).</em></li></ol><p><em>Therefore, we turned to simulation. In this post, we describe how to efficiently simulate wave-based optics to replicate an imaging system, and we provide Python code that is compatible with PyTorch 🔥</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GKJGKjGfrmeYY7En" /><figcaption>Photo by <a href="https://unsplash.com/@mattpaul?utm_source=medium&amp;utm_medium=referral">Matt Paul Catalano</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When developing algorithms that try to make sense of their surroundings through sensors (cameras, microphones, temperature, etc.), the availability of real-world data can be vital. However, certain constraints may make it impractical or even unethical to obtain such data. For example, it may be too time-consuming and cumbersome to manually record the data, or too invasive to place a camera or microphone in a private setting. To this end, simulation can provide an attractive alternative to obtain large amounts of data <em>quickly and cheaply</em>. Moreover, simulation can serve as a useful sanity check before assembling a complicated physical setup.</p><p>For a recent work on <a href="https://arxiv.org/abs/2211.12864">privacy-enhancing classification with lensless cameras</a>, we needed a large set of images for training and testing purposes. Moreover, this had to be collected for multiple cameras, namely different mask-based lensless cameras, which amount to replacing the lens with another type of “encoding” function in the form of a mask. The image below shows the difference between a conventional lensed camera and a mask-based lensless camera. See <a href="https://medium.com/@bezzam/a-complete-lensless-imaging-tutorial-hardware-software-and-algorithms-8873fa81a660">this post</a> for more on lensless imaging.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*8DvmD0fK3P8-ZM5RU3rVOQ.png" /><figcaption>Conventional <strong>(top)</strong> vs. lensless <strong>(bottom)</strong> imaging. Image by author.</figcaption></figure><p>In our work, we compared different mask designs and, for one of the cameras, we “learned” the best mask for a given task. This “learning” amounted to adjusting the mask pattern, similar to updating the weights of a neural network. Consequently, at each update-step (i.e., after performing gradient descent to update the mask), our system would yield a completely different set of measurements due to a change in camera hardware (i.e., mask pattern), meaning we would have to re-collect our dataset. This would be highly impractical for tens of thousands of images! Simulations allow us to “re-collect” this new dataset numerically.</p><h3>From scene to sensor ➡️</h3><p>The first step in simulation is identifying an appropriate model. We assume that the scene is a 2D plane perpendicular to the sensor plane and at a distance <em>d1</em> from our camera. We can model the scene-to-sensor relationship as a matrix-vector multiplication:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/1*ChNBE2rXqls2zail6jYPsQ.png" /></figure><p>where <strong>y</strong> is a vectorized version of the 2D sensor measurement, <strong>x</strong> is a vectorized version of the 2D scene, and <strong>H</strong> is a dense matrix to characterize the input-output relation, sometimes called the <em>transmission matrix</em> in <a href="https://arxiv.org/abs/0910.5436">optics literature</a>. In a typical lensed camera, this <strong>H</strong> should be close to identity. For a lensless camera, there is a one-to-many mapping between the scene and the sensor, resulting in a highly multiplexed image (as shown in “lensless capture” in the image above).</p><p>Depending on the scene and sensor resolutions, <strong>H </strong>can be very large, namely 10⁶ x 10⁶ for 1-megapixel (MP) scene and sensor resolution. To reduce the size of the “effective” size of <strong>H</strong>, a common assumption is to assume <a href="https://en.wikipedia.org/wiki/Shift-invariant_system">linear shift invariance</a> (LSI), or “infinite memory effect” in optics terminology.</p><p>Consequently, we can use a convolutional model to describe the relationship between the scene and the sensor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*OKO556CZBRxCWOmCizR2kQ.png" /></figure><p>where <strong>p</strong> is typically a 2D filter or kernel, and the rows of <strong>H</strong> in the matrix-vector formulation would be shifted versions of the vectorized <strong>p</strong>. This <strong>p</strong> has a few names in literature: <em>impulse response</em> or <em>point spread function</em> (PSF). We will use the latter, which is more common in optics and imaging. For our 1MP scene and sensor resolution example, our representation of <strong>H</strong> can be reduced from 10⁶ x 10⁶ parameters to 10⁶, and even smaller for PSFs with a compact support, e.g. that of a lens.</p><h3>Obtaining the PSF 💥</h3><p>Now that we have a model, we need the different components and parameters involved, with the PSF being a key part of our simulation. There are two ways to obtain the PSF: (1) measuring it from the system itself or (2) simulating it. In <a href="https://medium.com/@bezzam/measuring-a-diffusercam-psf-and-raw-data-b01ee29eda4">this post</a>, we show how to measure the PSF for our low-cost lensless camera. In <a href="https://arxiv.org/abs/2211.12864">the paper</a> (Eq 4), we describe how to simulate the PSF of masks for which we have an analytic function <em>M(</em><strong>x</strong><em>)</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kFct3dHbb-Uddi0uaRPKMA.png" /><figcaption>Eq 4 from <a href="https://arxiv.org/abs/2211.12864">https://arxiv.org/abs/2211.12864</a></figcaption></figure><p>The above (rather ugly!) equation can be described by three steps:</p><ol><li>Propagate spherical waves to the mask according to the distance between the scene and the mask (<em>d1</em>).</li><li>Multiply with the mask.</li><li>Free-space optical wave propagation from the mask to the sensor (separated by a distance of <em>d2</em>). This propagation can be done by convolving with a wavelength-dependent kernel — <em>H</em>.</li></ol><h3><strong>Simulation 🤖</strong></h3><p>With a PSF in hand (whether by measurement or simulation) we are ready to simulate some data! Given a digital image (grayscale, RGB, or even hyperspectral), the following steps need to be performed.</p><ol><li><strong><em>Prepare object plane</em></strong><em>:</em> resize and pad the original image according to the physical dimensions of the setup and camera sensor.</li><li><strong><em>Convolve with PSF</em></strong><em>.</em></li><li>(Optionally) <strong><em>downsample</em></strong>: perhaps you use a higher resolution PSF than your actual camera sensor.</li><li><strong><em>Add noise</em></strong>: e.g. <a href="https://en.wikipedia.org/wiki/Shot_noise">shot noise</a> to replicate noise at the sensor or Gaussian noise.</li><li><strong><em>Quantize</em> </strong>according to the bit depth of the sensor.</li></ol><p>Appendix B of <a href="https://arxiv.org/abs/2211.12864">our paper</a> describes this process in more detail.</p><h3>Python implementation 🐍</h3><p>With <a href="https://github.com/LCAV/LenslessPiCam">LenslessPiCam</a> and <a href="https://pypi.org/project/waveprop/">waveprop</a>, you can readily perform the above simulation with a <a href="https://github.com/LCAV/LenslessPiCam/blob/main/data/psf/tape_rgb.png">PSF</a> (measured 40cm away) of our low-cost lensless camera that uses the Raspberry Pi HQ sensor. You can use a different PSF by simply specifying a different file path in the configuration files.</p><p>First download and install the necessary libraries:</p><pre># developer install of LenslessPiCam<br>git clone git@github.com:LCAV/LenslessPiCam.git<br>cd LenslessPiCam<br>conda create --name lensless python=3.9<br>conda activate lensless<br>(lensless) pip install -e .<br><br># extra dependencies for simulation and metrics<br>(lensless) pip install -r recon_requirements.txt</pre><h4>1) Simulating a single file</h4><p>A single file can be simulated for the lensless camera (and <a href="https://medium.com/@bezzam/lensless-imaging-with-the-raspberry-pi-and-python-diffusercam-473e47662857">reconstructed</a>) with the following <a href="https://github.com/LCAV/LenslessPiCam/blob/main/scripts/sim/single_file.py">script</a>:</p><pre># from LenslessPiCam<br>(lensless) python scripts/sim/single_file.py</pre><p>It will by default use the configuration from <a href="https://github.com/LCAV/LenslessPiCam/blob/main/configs/simulate_single_file.yaml">this file</a>, namely simulate an image of “3” from the MNIST dataset with an object height of 12cm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ZUC9rbsMdf5KXHubexfuA.png" /><figcaption>Outputs from <a href="https://github.com/LCAV/LenslessPiCam/blob/main/scripts/sim/single_file.py">scripts/sim/single_file.py</a>.</figcaption></figure><h4>2) Simulating a folder of files</h4><p>The following <a href="https://github.com/LCAV/LenslessPiCam/blob/main/scripts/sim/dataset.py">script</a> simulates an (1) entire dataset of lensless measurements, (2) recovers an estimate for each image, and (3) quantifies the reconstruction. Note that you should download a subset of the <a href="http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html">CelebA dataset</a> (from <a href="https://drive.switch.ch/index.php/s/Q5OdDQMwhucIlt8">here</a>) and place it in the data folder.</p><pre># from LenslessPiCam<br>(lensless) python scripts/sim/dataset.py</pre><p>It will by default use the configuration from <a href="https://github.com/LCAV/LenslessPiCam/blob/main/configs/simulate_dataset.yaml">this file</a>. The simulation will be done in RGB, and a random height and shift is applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yIl4q0EPjnKfafR6_3hrfw.png" /><figcaption>Outputs from <a href="https://github.com/LCAV/LenslessPiCam/blob/main/scripts/sim/dataset.py">scripts/sim/dataset.py</a></figcaption></figure><h4>3) Simulating a dataset with PyTorch compatibility</h4><p>The following <a href="https://github.com/LCAV/LenslessPiCam/blob/main/scripts/sim/torch_custom_dataset.py">script</a> creates a <a href="https://pytorch.org/tutorials/beginner/basics/data_tutorial.html">PyTorch </a><a href="https://pytorch.org/tutorials/beginner/basics/data_tutorial.html">Dataset and </a><a href="https://pytorch.org/tutorials/beginner/basics/data_tutorial.html">DataLoader</a> out of the above mini CelebA dataset, such that the simulated data can be conveniently used in a machine learning pipeline with PyTorch to train and/or test over batches.</p><pre># from LenslessPiCam<br>(lensless) python scripts/sim/torch_custom_dataset.py</pre><p>It will by default use the configuration from <a href="https://github.com/LCAV/LenslessPiCam/blob/main/configs/simulate_torch_custom_dataset.yaml">this file</a>, which will try to use a GPU (if available) for convolving each batch with the PSF. We have noticed that using a GPU can be <strong><em>considerably faster</em></strong>; this is set through the <a href="https://github.com/LCAV/LenslessPiCam/blob/c392a496d5fa16829e6cba79cd69178d33ade291/scripts/sim/torch_custom_dataset.py#L47">device_conv</a> parameter of SimulatedDatasetFolder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qc9MuYSB8oIQBq3__wpKaw.png" /><figcaption>Roughly 5x faster for the above example with a batch size of 4.</figcaption></figure><h4>4) Simulating a built-in PyTorch dataset</h4><p>As a final example, we show how to simulate an already available <a href="https://pytorch.org/vision/stable/datasets.html#image-classification">PyTorch Dataset</a> This can be done with the following <a href="https://github.com/LCAV/LenslessPiCam/blob/main/scripts/sim/torch_dataset.py">script</a>:</p><pre># from LenslessPiCam<br>(lensless) python scripts/sim/torch_dataset.py</pre><p>It will by default use the configuration from <a href="https://github.com/LCAV/LenslessPiCam/blob/main/configs/simulate_torch_dataset.yaml">this file</a>, which simulates a subset of MNIST in RGB (and downloads the dataset if not available locally). Another dataset can be set in the configuration file or through the Terminal.</p><pre># from LenslessPiCam<br>(lensless) python scripts/sim/torch_dataset.py files.dataset=cifar10</pre><p>At the moment only MNIST, FashionMNIST, and CIFAR10 are supported. Other datasets can be used by loading it as is normally done and passing the dataset object to <a href="https://github.com/LCAV/LenslessPiCam/blob/c392a496d5fa16829e6cba79cd69178d33ade291/scripts/sim/torch_dataset.py#L60">SimulatedPytorchDataset</a>.</p><h3>Conclusion</h3><p>And that’s it! We hope you find the above description and code useful for simulating your own data. Whether for lensless imaging, other computational imaging tasks, or other types of propagation, this approach of using an impulse response is a very convenient and flexible technique for many applications 🚀</p><h3>* Behind the scenes *</h3><p>For those interested in a deeper dive into the Python code, we’ll do that here.</p><p>The core class is <a href="https://github.com/LCAV/LenslessPiCam/blob/c392a496d5fa16829e6cba79cd69178d33ade291/scripts/sim/dataset.py#L50">FarFieldSimulator</a> within the <a href="https://pypi.org/project/waveprop/">waveprop</a> library (soon to be open-source on GitHub!). It is initialized with the following simulation parameters:</p><ul><li>Point spread function (PSF).</li><li>Object height, or a range of values.</li><li>Scene-to-mask distance.</li><li>Mask-to-sensor distance.</li><li>Sensor name, defined in <a href="https://github.com/ebezzam/waveprop/blob/cae81e3e4a205a5032485dffa40c2b1e5a554925/waveprop/devices.py#L62">waveprop.devices</a> (only “rpi_hq” as of Jan 2022).</li><li>(Optionally) output dimension to resize the image at the sensor.</li><li>(Optionally) signal-to-noise ratio (SNR) in dB for adding shot noise.</li></ul><p>After creating an instance of FarFieldSimulator, the <a href="https://github.com/LCAV/LenslessPiCam/blob/c392a496d5fa16829e6cba79cd69178d33ade291/scripts/sim/dataset.py#L65">propagate</a> method can be used to simulate a given digital image.</p><pre>simulator = FarFieldSimulator(<br>    psf=psf,<br>    object_height=object_height,<br>    scene2mask=scene2mask,<br>    mask2sensor=mask2sensor,<br>    sensor=sensor,<br>    output_dim=output_dim,<br>    snr_db=snr_db,<br>    max_val=max_val,<br>)<br>simulated_image = simulator.propagate(original_image)</pre><p>When calling propagate, the steps described under “Simulation 🤖” (above) are applied.</p><h4>PyTorch compatibility</h4><p>For use with PyTorch, the <a href="https://github.com/LCAV/LenslessPiCam/blob/c392a496d5fa16829e6cba79cd69178d33ade291/scripts/sim/torch_custom_dataset.py#L42">SimulatedDatasetFolder</a> and <a href="https://github.com/LCAV/LenslessPiCam/blob/c392a496d5fa16829e6cba79cd69178d33ade291/scripts/sim/torch_dataset.py#L60">SimulatedPytorchDataset</a> classes in waveprop provides a wrapper around FarFieldSimulator with the necessary __getitem__ and __len__ methods that are expected by a <a href="https://pytorch.org/tutorials/beginner/basics/data_tutorial.html#creating-a-custom-dataset-for-your-files">PyTorch Dataset</a> object.</p><p>Some features and a few things to keep in mind:</p><ul><li>The PSF must have the height and width as <strong><em>the final dimensions</em></strong>, as is the convention for images in PyTorch. This reshaping can be conveniently done with the <a href="https://pytorch.org/vision/stable/generated/torchvision.transforms.ToTensor.html?highlight=totensor">ToTensor</a> method (as well as normalization within [0, 1]).</li></ul><pre>from lensless.io import load_psf<br>from torchvision.transforms import ToTensor<br><br><br>psf = load_psf(psf_fp)<br>psf = ToTensor()(psf)</pre><ul><li>For SimulatedDatasetFolder, the dataset path and the image extension should be provided:</li></ul><pre>ds = SimulatedDatasetFolder(<br>    ...<br>    path=ds_path,<br>    image_ext=&quot;jpg&quot;,    # defaults to JPG<br>)</pre><ul><li>For SimulatedPytorchDataset, a PyTorch Dataset is provided as input:</li></ul><pre>ds_prop = SimulatedPytorchDataset(<br>    dataset=ds,<br>    ...<br>)</pre><ul><li>Random augmentation can be applied to both SimulatedDatasetFolder and SimulatedPytorchDataset: horizontal/vertical flipping, rotation, rescaling (height), and shifting.</li></ul><pre>ds = SimulatedDatasetFolder(       # or SimulatedPytorchDataset<br>    ...<br>    object_height=[0.1, 0.4]  # uniformly pick from this range<br>    random_vflip=0.5,      # probability<br>    random_hflip=0.5,      # probability<br>    random_rotate=90,      # random rotation within [-90, 90]<br>    random_shift=True,     # randomly shift while being fully visible<br>)</pre><ul><li>Indexing the new dataset returns a simulated image and a target, which you can decide to be (1) the original image, (2) the image at the object plane (original image resized and padded to match the PSF shape and object height), or (3) the label of the original dataset (only for SimulatedPytorchDataset e.g. if you want to return the MNIST digit or CIFAR label).</li></ul><pre>ds = SimulatedPytorchDataset(<br>    ...<br>    target=&quot;original&quot;,  # &quot;original&quot; or &quot;object_plane&quot; or &quot;label&quot;<br>)<br><br>target, simulated_image = ds[0]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faf3fa620789" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>