<?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 Nour on Medium]]></title>
        <description><![CDATA[Stories by Nour on Medium]]></description>
        <link>https://medium.com/@noureldinyosri?source=rss-8425ef817990------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Nour on Medium</title>
            <link>https://medium.com/@noureldinyosri?source=rss-8425ef817990------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 16:39:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@noureldinyosri/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[An Introduction To Quantum Cryptography]]></title>
            <link>https://medium.com/@noureldinyosri/an-introduction-to-quantum-cryptography-1eeccb6c1a60?source=rss-8425ef817990------2</link>
            <guid isPermaLink="false">https://medium.com/p/1eeccb6c1a60</guid>
            <category><![CDATA[quantum]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[quantum-cryptography]]></category>
            <category><![CDATA[online-learning]]></category>
            <dc:creator><![CDATA[Nour]]></dc:creator>
            <pubDate>Mon, 03 Oct 2022 19:39:28 GMT</pubDate>
            <atom:updated>2022-10-03T19:44:42.599Z</atom:updated>
            <content:encoded><![CDATA[<p>Earlier this year, I took MIT’s online version of <a href="https://www.edx.org/course/applications-of-quantum-mechanics">806 quantum physics III</a>, as part of the course work students of the verified track were required to write a paper about an application of quantum physics. I chose to write mine on quantum cryptography since I have been fascinated by quantum computing eversince I took UC Berkely’s <a href="https://www.edx.org/course/quantum-mechanics-and-quantum-computation">online course</a> in 2013–2014.</p><p><a href="https://drive.google.com/file/d/1aoHL7uUxWUf35cAdK_Dj-CexifkOFHCY/view?usp=sharing">Here is the paper</a> incase you do not want to read the rest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*6usYfgsRdK_kWQd3sIyWEQ.gif" /><figcaption>source: <a href="https://www.cse.wustl.edu/~jain/cse571-07/ftp/quantum/">Mart Haitjema</a></figcaption></figure><h3>Background</h3><p>I have been fascinated by quantum physics since I was a teenager, at that time I couldn’t think of becoming anything other than a mathematician or a theoritical physicist. I did not wait until starting college; instead I made my way through college level math and physics textbooks and video lectures like <em>Mathematical Methods for Physics and Engineering</em>, <em>University Physics with Modern Physics</em>, the <a href="https://podcasts.ox.ac.uk/series/quantum-mechanics"><em>Oxford lectures on quantum mechanics</em></a>, and some introductory notes on relativity.</p><p>And even though life had a different opinion and I ended up being a software engineer. I still read alot of math and physics books, take online courses, and I also contribute to Google’s opensource quantum computing library <a href="https://quantumai.google/cirq">Cirq</a>.</p><h3>The Paper</h3><p>Initially I wanted to write an introduction that assumes no prior knowledge beyond high school physics. I also wanted to cover a lot more topics, however I was constrained by three factors:</p><ul><li>A 7-page limit.</li><li>The peer reviews on the first draft suggested that I cut down on the prerequists since the audience was fellow students who are already familiar with the physics.</li><li>I realised that if I cover everything I wanted to cover the paper will turn into a survey of the field which was not my intended goal, though I might eventually write it.</li></ul><p>The paper ended up getting 90% of the score, however reading through it again I wanted to change and improve a few things but I realised that I would endup rewriting it, however I did add a minor change, where I discuss the proof that the probablity of an error in one of the algorithms dies exponentially quickly. I originally refered the reader to the complicated combinatorial proof in <a href="https://www.cambridge.org/highereducation/books/quantum-computation-and-quantum-information/01E10196D0A682A6AEFFEA52D53BE9AE#overview">quantum computing and quantum information</a>, however I kept thinking that the formula seemed familiar but I couldn’t remember to what; A few months ago I was revising probability and statistics when I remembered the Hoeffding’s inequality and that the result I needed follows by direct substitution into it.</p><p><a href="https://drive.google.com/file/d/1aoHL7uUxWUf35cAdK_Dj-CexifkOFHCY/view?usp=sharing">paper link.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eeccb6c1a60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Udacity’s Machine Learning Nano-degree Experience]]></title>
            <link>https://medium.com/@noureldinyosri/udacitys-machine-learning-nano-degree-experience-c1b601e59d85?source=rss-8425ef817990------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1b601e59d85</guid>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[udacity-nanodegree]]></category>
            <dc:creator><![CDATA[Nour]]></dc:creator>
            <pubDate>Sun, 19 Jan 2020 10:49:18 GMT</pubDate>
            <atom:updated>2020-01-19T10:52:28.973Z</atom:updated>
            <content:encoded><![CDATA[<p>Two months ago I was <a href="https://medium.com/@noureldinyosri/aws-deepracer-scholarship-im-in-6464deefb4b0">one of the winners</a> of the #UdacityAWSDeepRacerChallenge scholarship and so I was enrolled free of charge into udacity’s machine learning nano-degree</p><h3>My Background</h3><p>-this is quite long and boring so you can <a href="#fb7d">jump a head to the review</a></p><p>I’m a computer engineer (class of 2017) but my story with AI and ML started long before that, in particular it started in 2012 when Stanford university kickstarted the MOOCs revolution* with their AI, ML and databases courses, at that time I was a high school student who enjoyed working or robotics project so naturally I enrolled in the AI and ML courses and to my surprise I was able to cope with the course work and passed.</p><p>In college I took every AI/ML related course that my university offered and was top of my class in all of them, took a lot of online AI/ML courses from udacity, coursera and edx, I also worked on my own projects in my free time, however my main focus was in programming competitions (e.g. ICPC, codeforces, topcoder etc) in which I won several national and regional awards and represented Africa and the middle east in the world finals of ICPC.</p><p>*yes I know that MIT, Yale, Oxford and several other elite universities had already big repositories of course materials including video lectures -I took a large percentage of MIT’s math, CS and physics online courses and watched oxford’s quantum mechanics lectures by professor James Binney- however MOOCs have all that as well as any number of features including projects, office hours, one-to-one guidance and gift cards for software/services (e.g. AWS, Matlab)</p><h3>Program Structure</h3><p>the nano-degree is split over 7 parts (4 core and 3 elective) which are</p><ol><li>Software Engineering Fundamentals -core-: <br>introduces SWE best practices like modularity, logging, version control, OOP and design patterns.</li><li>Machine Learning in Production -core-: <br>teaches the workflow in production and uses mainly AWS services but also outlines similarities and differences with other services (Google’s ML engine, and Microsoft’s Azure).</li><li>Machine Learning, Case Studies -core-: <br>works through three main projects ‘population segmentation’, ‘payment fraud detection’ and the third one was an example of how to build custom model, so instead of using AWS ‘s built-in algorithms we can build custom algorithms and it mainly focus on PyTorch</li><li>Natural Language Processing (NLP) fundamentals -elective-</li><li>Convolutional Neural Networks -elective-</li><li>Web Deployment with Flask -elective-</li><li>Graduation Project -core :D- : <br>for this we were given suggestions as well as the freedom to choose any project we like (e.g. from kaggle or invent something), <a href="https://github.com/NoureldinYosri/Bertelsmann-Arvato-Udacity-Graduation-Project">my code is here</a></li></ol><ul><li>we were also given a 100$ AWS gift card to be able to work through the projects.</li><li>naturally I completed all core and elective parts :D</li></ul><h3>Projects</h3><p>We worked on several projects, some example projects during the course, 2 capestone projects and the graduation project.</p><ul><li>Example Projects: these were simple projects defined to help us understand a certain concept or tool and was guided in the video lectures and had model solutions</li><li>Capestone Projects: in a sense were like a typical programming pset e.g. didn’t have model solution and we were mostly on our own working through them but they were guided in the sense that we were given an outline of the project so that we only needed to focus on the important parts of the project (handling data, modeling, training/validating/testing and deploying) while most boilerplate code was provided.</li><li>Graduation Project: I had to do everything, starting from writing a project proposal, obtaining data, cleaning it, defining metrics and a baseline model, training validating testing and deploying, ..etc</li></ul><blockquote>An important and Integral part of the nano-degree are reviews provided by udacity tutor on our submitted projects, the tutors would review the code and decide whether to passes or not, suggest improvements and give hints/links to learn more on particular points</blockquote><p>Most reviews I received were very constructive and helpful suggesting ways to improve parts of the my projects and giving links to material further expanding on certain points.</p><p>Another important part -though I didn’t use it- were discussion forms where students can ask questions and interact with tutors.</p><h3>Review</h3><p>Most reviews I received were very constructive and helpful suggesting ways to improve parts of the my projects and giving links to material further expanding on certain points.</p><p>Overall I really liked and enjoyed the nano degree and would encourage anyone to take it :D</p><h3>The Certificate</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*--50m-kbZF29rR93rGjbPw.png" /><figcaption>verification <a href="https://graduation.udacity.com/confirm/7DM2T3JL">link</a></figcaption></figure><h3>Closing note</h3><p>as I mentioned earlier I took the original AI class from Stanford whose link was ai-class.com which now redirects to udacity, however when I try to download my certificate for that course I get redirected to a 404-page :(</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ziN-k0PFA9X-prq08J_l-g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1b601e59d85" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[300 Solved Project Euler Problems]]></title>
            <link>https://medium.com/@noureldinyosri/300-solved-project-euler-problems-f1f0ff657e24?source=rss-8425ef817990------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1f0ff657e24</guid>
            <category><![CDATA[math]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[project-euler]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <dc:creator><![CDATA[Nour]]></dc:creator>
            <pubDate>Thu, 21 Nov 2019 11:49:36 GMT</pubDate>
            <atom:updated>2019-11-21T11:50:00.526Z</atom:updated>
            <content:encoded><![CDATA[<p>Woohoo, I’ve finally done it and solved my 300th project Euler problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UuJwMbTbqUsNWjPdUnVYVA.jpeg" /></figure><p>In case you don’t know what <a href="https://projecteuler.net/">projecteuler.net</a>, it’s website that provides problems that require mathematics as well as programming skills to be solved.</p><p>The first time I was on the site -and I have no idea how I found it- was seven years ago, at that time I was a senior high school student with some programming experience from working on robotics projects + I was the best in my school in math since 7th grad, the site had ~300 problems and I was so stupid/naive to think that I can solve all of them within a year, fast forward seven years later, today I just managed to solve my 300th problem while the number of problems has more than doubled to be 689.</p><h4>what does it mean ?</h4><p>well according to project euler now I’m in the top 0.08% of participants, however to me it’s much more than that, I didn’t have a formal mathematics training beyond what a computer engineering degree provide and most of what I know comes from reading books and training for programming competitions, so making it this far is a big deal for me and a personal triumph.</p><p>To put it more clearly, when I started 7 years ago I didn’t know anything, for example I had my computer run for an hour to compute the first one million primes, something which can be done in a few milliseconds using sieve algorithm-but of course I did not know that at the time-, but by now I have acquired an arsenal of techniques, tricks, algorithms and theorems that I can use to solve problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*3GtHcQylUdUcl6hXyZoZtw.png" /></figure><p>For sometime now I feel like I’m running out of tricks, the problems are becoming harder, but it’s part of a lifelong journey of learning, in fact one of the reasons I’m writing this blog is to try to to connect with more skilled participants to try to learn from them.</p><h4>What do you need to know to solve those problems ?</h4><p>to start you just need to be comfortable with math, most people are intimidated by math, but for me math has always been my best friend to the point that I have developed the habit of solving problems whenever I’m sad or put down, whenever I’m free actually.</p><p>back to the question, from my experience, if I would rank project euler problems then</p><ol><li>easy — solve using pencil and paper (and sometimes a calculator): most of those are in the first 50 problems</li><li>easy — a programming exercise and easy recreational mathematics: most of them in the first 100 problems but occasionally you might find a few of them scattered here and there</li><li>medium — data structures: although they don’t really fit in the spirit of the website you will find a few data structures problems here and there (my 300th solved problem for instance)</li><li>medium — counting, probabilities and basic number theory: although the website generally gives them high difficulty levels, personally I found them average sometimes even easy -the ones that I solved anyway- but perhaps that has to do with my background in competitive programming where these types of problems pop often.</li><li>hard — advanced counting and problems requiring acquaintance with theories from analytical number theory: generally Dirichlet, and the inclusion exclusion principle are your friends in those problems.</li><li>Deadly — those are the problems that I have no idea how to even start thinking about them, most of the problems I haven’t solved yet fall into this category.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ax2EjYPOFHdVHrI7AbxpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*Tmmh23E1eR3N4OoPIQL5KA.png" /><figcaption>my progress</figcaption></figure><p>there is a certain beauty in being one of the first solvers of a problem ❤ :D</p><h3>Project Euler on Twitter</h3><p>47th solver of Problem687 is Noureldin from Egypt.</p><p>on a side note, for over 2 years now I’ve been the top ranked in my country</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*v7PJ7K_yEIMqfQCyO_cISA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1f0ff657e24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS DeepRacer Scholarship; I’m IN]]></title>
            <link>https://medium.com/@noureldinyosri/aws-deepracer-scholarship-im-in-6464deefb4b0?source=rss-8425ef817990------2</link>
            <guid isPermaLink="false">https://medium.com/p/6464deefb4b0</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[udacity-nanodegree]]></category>
            <category><![CDATA[udacity]]></category>
            <dc:creator><![CDATA[Nour]]></dc:creator>
            <pubDate>Tue, 19 Nov 2019 11:10:37 GMT</pubDate>
            <atom:updated>2019-11-19T11:10:37.737Z</atom:updated>
            <content:encoded><![CDATA[<p>A few months ago Udacity announced AWS’s DeepRacer scholarship, a scholarship to study Udacity’s ML nanodegree to obtain which you have to be in the top 200 performers -among the applicants- in amazon’s <a href="https://aws.amazon.com/deepracer/">deepracer challenge</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FE3W8HnKKZz0%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DE3W8HnKKZz0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FE3W8HnKKZz0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8e02e08c6b7db0840710fc9ec45f0b8/href">https://medium.com/media/c8e02e08c6b7db0840710fc9ec45f0b8/href</a></iframe><p>As the competition is structured we only have to fill in the code for the reward function -different reward functions =&gt; different ways of interpreting and acting on information =&gt; different performance) while the rest of the reinforcement learning setup is provided by AWS.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FaiVsu4izt0o%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DaiVsu4izt0o&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FaiVsu4izt0o%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/70d8a32242a7438ad8b5f8adc2adf734/href">https://medium.com/media/70d8a32242a7438ad8b5f8adc2adf734/href</a></iframe><p>When I heard about the competition I was very excited but I also had double feeling about this, on the one hand I had some experience and knowledge for reinforcement learning having training an agent to play AirRaid the famous atari game I used to play as kid using <a href="https://gym.openai.com/envs/AirRaid-ram-v0/">openai’s gym environment</a> for my AI class -all my class mates wrote classical search algorithms but I wanted to work on something as close as possible to the work done by people at the frontier of AI- and I read Sutton’s AI book back to back, on the other hand I didn’t do any hard core,state of the art work or deploy any production models.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FtmTm7ODgIhw%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DtmTm7ODgIhw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FtmTm7ODgIhw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b206d7347c0698fcb78dfeec9cd6cb2/href">https://medium.com/media/6b206d7347c0698fcb78dfeec9cd6cb2/href</a></iframe><p>Two days ago I received a “congratulations” email -which is a good change from the “unfortunately” emails I’ve been receiving for the past 4 months, applying for jobs you know- and the nano degree starts today :D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*ywsYj_pU8OhMqH_SUu5UbA.jpeg" /></figure><p>this is specially great because as someone who suffered a great setback* I’m trying to put my life back together and start a career.</p><p>— — — — — — — — — — — —</p><p>*tldr; my country has compulsory military service which I had to do right after graduation, so although I graduated 2 years ago, 14 months of those were in the military, so it’s hard applying for jobs because technically I’m not a fresh grad so companies expect that I’ve at least one year of experience, however I’ve the experience of a fresh grad (2 internships).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6464deefb4b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[yet another neural style transfer project, or what if Van Gogh painted the pyramids]]></title>
            <link>https://medium.datadriveninvestor.com/yet-another-neural-style-transfer-project-or-what-if-van-gogh-painted-the-pyramids-f0827f90c0fe?source=rss-8425ef817990------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0827f90c0fe</guid>
            <category><![CDATA[convolutional-network]]></category>
            <category><![CDATA[style-transfer]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Nour]]></dc:creator>
            <pubDate>Fri, 19 Oct 2018 14:26:38 GMT</pubDate>
            <atom:updated>2018-11-02T05:44:57.325Z</atom:updated>
            <content:encoded><![CDATA[<p>As AI progressed and became a game changer in a lot of fields and tasks, people started to wonder when it will be able to create works of artistic style, but it wasn’t until August 2015 when Gatys et el made their breakthrough and published their paper “A Neural Algorithm of Artistic Style” -<a href="https://arxiv.org/abs/1508.06576">arXiv</a></p><p>the paper capitalized on an understanding of what information is stored in different layers of deep convolution neural network</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcNBBNAxC8l4%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcNBBNAxC8l4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcNBBNAxC8l4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/79f87861db58db681450cb94f1d9872f/href">https://medium.com/media/79f87861db58db681450cb94f1d9872f/href</a></iframe><p>as can be seen in the above video the first few layers act as simple filters which detect simple stuff like corners, edges ..etc while medium level layers can detect objects ,but what about outer layers ? … when I first played with DCNN I thought that those layers simply directed the NN’s attention to specific regions in the input image specially after using it to classify animals and seeing that when given an image of an elephant one of the outer filters singled out the elephant’s ears</p><p>however that’s not all that there is to it, as it turned out outer layers also hold information about what we call style and texture and as Gatys and company showed one can use those information to blend together the content (edges,corners,objects ..etc) of one image and the style elements of another and demonstrating their results by blending together an image of Tubingen-Germany with the style of Van Gogh’s ‘the starry night’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*_NG0329ocrmqAap4a82P9A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5i9XZIQjgc1puWFyYrj6HQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*3plQWu_L4bl27RWVBexrsg.jpeg" /><figcaption>starry night + Tubingen = my result</figcaption></figure><p>their idea was to define error terms for the loss of content and style</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*9jfm63knh2l1vRMWTCAP9Q.png" /></figure><p>if at layer l the constructed image produces features F and the content image produces features P then the loss in content is simply half the sum of squared differences and as the authors explain we only need to use one layer for content.</p><p>however for style it becomes a little tricky, first we compute the Gramian matrix of the features at layer of interest for both the generated image (G) and the style image (A)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/1*SCL5sRhC0FglCDMBZNYDtQ.png" /><figcaption>Gramian matrix</figcaption></figure><p>the the style loss at layer l is given by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*8YqrC_RuduTvFGsEIqiz2w.png" /></figure><p>where N_l is the depth of the layer and M_l is the area/size of the filtered image</p><p>And the total loss is a weighted sum of those losses, however results with that loss function were not smooth and so it was suggested to add another loss term the ‘total variation’ loss which minimizes the difference between adjacent pixels making the transitions smoother</p><h3>My Implementation</h3><p>I implemented the paper using keras as my DL lib and running on Colab while closely following the official <a href="https://github.com/keras-team/keras/blob/master/examples/neural_style_transfer.py">example</a> by keras team, my code can be found on my <a href="https://github.com/NoureldinYosri/deep-dive/blob/master/style_transfer.ipynb">github</a></p><h3><strong>Results</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*2mHt8p86_kqwz9wCs0ZcUQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*_NG0329ocrmqAap4a82P9A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*7QCSWAv7Xw8mUr63uFkvUQ.jpeg" /><figcaption>pyramids + van gogh’s starry night</figcaption></figure><p>well the texture is certainly being transferred but still it is not that eye catching with that batch of green in the middle left which comes from the style image rather than from the content image + the complete blurring of the riders in black in the bottom and making them seem like a hole in the image, one however can try to use different weights to get better blending</p><h3>References</h3><ol><li><a href="https://arxiv.org/abs/1508.06576">A Neural Algorithm of Artistic Style</a></li><li><a href="https://medium.com/data-science-group-iitr/artistic-style-transfer-with-convolutional-neural-network-7ce2476039fd">Artistic Style Transfer with Convolutional Neural Network</a></li><li><a href="https://markojerkic.com/style-transfer-keras/">Marko Jerkic’s tutorial</a></li><li><a href="https://medium.com/tensorflow/neural-style-transfer-creating-art-with-deep-learning-using-tf-keras-and-eager-execution-7d541ac31398">Neural Style Transfer: Creating Art with Deep Learning using tf.keras and eager execution</a></li><li><a href="https://medium.com/mlreview/making-ai-art-with-style-transfer-using-keras-8bb5fa44b216">Making AI Art with Style Transfer using Keras</a></li><li><a href="https://github.com/keras-team/keras/blob/master/examples/neural_style_transfer.py">kera’s official example</a></li><li>all images from google — except of course the 2 output images</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0827f90c0fe" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/yet-another-neural-style-transfer-project-or-what-if-van-gogh-painted-the-pyramids-f0827f90c0fe">yet another neural style transfer project, or what if Van Gogh painted the pyramids</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generating Text: bringing back sherlock holmes]]></title>
            <link>https://medium.datadriveninvestor.com/generating-text-talk-like-sherlock-holmes-593aa22da8ea?source=rss-8425ef817990------2</link>
            <guid isPermaLink="false">https://medium.com/p/593aa22da8ea</guid>
            <category><![CDATA[lstm]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[rnn]]></category>
            <dc:creator><![CDATA[Nour]]></dc:creator>
            <pubDate>Fri, 28 Sep 2018 15:23:17 GMT</pubDate>
            <atom:updated>2018-11-02T05:26:17.381Z</atom:updated>
            <content:encoded><![CDATA[<ul><li><strong>then my friend ros</strong>e and confided that he had seen<br>his father</li><li><strong>deep learning</strong>. ?”“i am afraid that i have not seen the matter stated.”</li><li><strong>i think</strong> that i have seen<br>the man</li></ul><p>The previous 3 statements are the output of a deep learning model training on the adventures of sherlock holmes and given initial words (written in bold) … here is how it works</p><p>There is no doubt that deep learning is currently the hottest topic in AI after its successive successes in different application including vision ,generating art, image captioning, generating text among others.</p><p>One of the the famous results is this harry potter chapter written by AI</p><h3>Botnik Studios on Twitter</h3><p>We used predictive keyboards trained on all seven books to ghostwrite this spellbinding new Harry Potter chapter https://t.co/UaC6rMlqTy</p><p>After reading several tutorials on char level generating models (1–4 in references) I wanted to try my hand at building my own model but first things first … the <a href="https://github.com/NoureldinYosri/deep-dive/blob/master/language_model_LSTM.ipynb">code/notebook</a></p><h3>The Model</h3><p>I used a model that consisted of 2 LSTM layers (each with 256 units) and one dense (fully connected) layer for output with categorical cross entropy cost and dropout for regularization</p><p>What are and Why use LSTMs ?</p><p>Long short-term memory (LSTM) units are a type of units used in building recurrent neural networks (RNNs) which has ability to use/remember information from past states, and NN built using them (aka language models) are currently the go to networks for natural language processing</p><h3>The Data</h3><p>I used the book “The Adventures of Sherlock Holmes” by Arthur Conan Doyle downloaded from project gutenberg as a training corpus</p><h3>Preprocessing</h3><p>After downloading the book I manually removed the heading and tail which contains info about project gutenberg, then in code I converted all english chars to their lowercase form and split the text into sentences each of length 100 chars and encoded them using one-hot encoding</p><h3>Training</h3><p>Originally I wanted to run the ‘adam’ optimizer for a 100 epochs using batch size of 512</p><p>However the training data was too big to be held in ram so I split it into blocks each of size 50,000 sentences and for a 100 times I split the data into blocks and ran one step of adam on each block</p><h3>Results</h3><p>The model can correctly output long sentences with correct english words and punctuation which are sometimes as intelligible as any human written sentence, but most of the time is nothing more that hallucinations.</p><p>One can reason about that by noting that think of a meaning then choose our words then write those words while what we forcing the model to do is to write character after character with no notion of meaning, it’s like having to write an essay with no topic/info while being drunk</p><h3>Research directions and Improvements</h3><p>Inspired by the success of generative models in vision one can wonder whether we can replicate that success in text generation.</p><p>The go to methods in that case are generative adversarial nets (GANs) and variational autoencoders (VAEs) however as the Ian Goodfellow (the inventor of GANs) descripts in this <a href="https://www.reddit.com/r/MachineLearning/comments/40ldq6/generative_adversarial_networks_for_text/cyyp0nl/">reddit post</a> GANs are not suited for text tasks because they require a continuous space to work in while text is discrete by nature and even if we use vector embedding of words that won’t help because if a word is encoded using vector V the V + dV will map to V (where dV is infinitesimal) while if I is an Image then I + dI is a different image (however slightly)</p><p>Thus there has been attempts to use generative models which can deal with discrete space (e.g. VAEs) however the experiments conducted by Bowman et al., 2015 [5] Showed that variational autoencoders (VAE) with LSTM decoders perform worse than simpler LSTM language models (e.g. the model we have just trained)</p><p>Another path that researchers are attempting is to combine several models like (VAE + CNN) [6] and combining VAE, RNN and/or fully connected layers [7] [8]</p><h3>References</h3><ol><li><a href="http://karpathy.github.io/2015/05/21/rnn-effectiveness/">The Unreasonable Effectiveness of Recurrent Neural Networks</a></li><li><a href="https://machinelearningmastery.com/text-generation-lstm-recurrent-neural-networks-python-keras/">Text Generation With LSTM Recurrent Neural Networks in Python with Keras</a></li><li><a href="https://chunml.github.io/ChunML.github.io/project/Creating-Text-Generator-Using-Recurrent-Neural-Network/">Creating A Text Generator Using Recurrent Neural Network</a></li><li><a href="https://medium.com/@shivambansal36/language-modelling-text-generation-using-lstms-deep-learning-for-nlp-ed36b224b275">Language Modelling and Text Generation using LSTMs — Deep Learning for NLP</a></li><li><a href="https://nlp.stanford.edu/pubs/snli_paper.pdf">A large annotated corpus for learning natural language inference</a></li><li><a href="http://proceedings.mlr.press/v70/yang17d/yang17d.pdf">Improved Variational Autoencoders for Text Modeling using Dilated Convolutions</a></li><li><a href="https://www.aclweb.org/anthology/D17-1066">A Hybrid Convolutional Variational Autoencoder for Text Generation</a></li><li><a href="https://arxiv.org/pdf/1712.00170.pdf">Text Generation Based on Generative Adversarial Nets with Latent Variable</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=593aa22da8ea" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/generating-text-talk-like-sherlock-holmes-593aa22da8ea">Generating Text: bringing back sherlock holmes</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Egyptian Olympiad of Informatics (EOI) 2017]]></title>
            <link>https://medium.com/@noureldinyosri/egyptian-olympiad-of-informatics-eoi-2017-5b0ee6b126ee?source=rss-8425ef817990------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b0ee6b126ee</guid>
            <category><![CDATA[volunteering]]></category>
            <category><![CDATA[ioi]]></category>
            <category><![CDATA[eoi]]></category>
            <dc:creator><![CDATA[Nour]]></dc:creator>
            <pubDate>Sat, 19 Aug 2017 17:20:22 GMT</pubDate>
            <atom:updated>2018-09-28T17:31:38.478Z</atom:updated>
            <content:encoded><![CDATA[<p>over the past week the first 2 stages of the <a href="http://egyptian/%20Olympiad%20in%20Informatics%20(EOI)">Egyptian IOI</a> team selection process was conducted and I was involved in the second one as a problem setter of 7 of the 8 problems featured in it and I was the admin/judge during the contests</p><ul><li>1st stage</li></ul><p>an online IQ test and an online contest of 3 problems … the scores were summed and the best 56 were invited to the arab academy for science, technology &amp; maritime transport (AAST)</p><ul><li>2nd stage</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*kb44fFS7qtaYnMPb" /></figure><p>a warmup contest of 2 problems (which couldn’t be conducted due to onsite issues) followed by 2 contests over 2 days (Friday 18-Aug and Saturday 19-Aug) each contest had 3 problems</p><p>the first contest was good although I discovered a bug in the judge solution for the medium problem after an hour into the contest .. the solution was written by me ,I asked my friend <a href="http://codeforces.com/profile/Ahmad_Elsagheer">Ahmad Elsagheer</a> to write another solution while I debugged mine … as it turns out the problem was due to a loose null pointer …. I fixed it and asked the onsite administrators to extend the contest by one hour to compensate for the hour lost while debugging and uploading the new test data and they agreed … and 3 contestants managed to get full score</p><p>I learnt the lesson from the issues that happened during the first day and so spent the night making sure of everything from making sure the solutions were correct to making stronger tests to improving the statement and in all I had the help of Ahmed Elsagheer and the result is that the second contest was very smooth</p><p>the second contest was very smooth … no one managed to get full score … the hardest problem had 3 subtasks, only 1 contestant managed to solve the second of them because third subtask needed knowledge and expertise of the convex hull trick a dynamic programming optimization technique that uses geometric interpretation of equations to reduce the time complexity from</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/16/0*swBnAy8AvckQYPPz" /></figure><ul><li>to</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/72/0*j408UD04jL6l8e4m" /></figure><ul><li>and sometimes to O(n)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*cHy8KtMLD6kd4Fd_" /></figure><ul><li>the scores of the two contests were combined and the best 20 are invited to a training camp at AAST during the winter vacation before the final selection stage where 4 will form the team that will represent Egypt</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*yDI2grpBM18vNHrU" /></figure><p>and the usual <a href="https://www.facebook.com/eoi.eg/posts/1219582268143652">thanking post</a></p><ul><li>3rd stage</li></ul><p>will be during the winter vacation where a training camp will be held at AAST and then the final selection contest</p><p><em>Originally published at </em><a href="https://noureldinyosri.wordpress.com/2017/08/19/egyptian-olympiad-of-informatics-eoi-2017/"><em>noureldinyosri.wordpress.com</em></a><em> on August 19, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b0ee6b126ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>