<?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 Miguel Morales on Medium]]></title>
        <description><![CDATA[Stories by Miguel Morales on Medium]]></description>
        <link>https://medium.com/@mimoralea?source=rss-3d2d8215bd6d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*apvJQvQwYUDQtkK9tt0K0Q.jpeg</url>
            <title>Stories by Miguel Morales on Medium</title>
            <link>https://medium.com/@mimoralea?source=rss-3d2d8215bd6d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 07:03:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mimoralea/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[Dump R data for later reuse]]></title>
            <link>https://medium.com/@mimoralea/dump-r-data-for-later-reuse-5714ce113727?source=rss-3d2d8215bd6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/5714ce113727</guid>
            <category><![CDATA[r]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Miguel Morales]]></dc:creator>
            <pubDate>Sun, 19 Feb 2017 01:32:00 GMT</pubDate>
            <atom:updated>2017-02-19T01:32:00.499Z</atom:updated>
            <content:encoded><![CDATA[<p>Nice! You are starting to do some EDA, and found some cool features on the dataframe. However, time is up and you must continue at a later time?</p><p>No problem, just save a dump of that object and load it back when you are ready to continue!</p><p>Save the object:</p><pre>save(df, file=&quot;2015-08-12-df.RData&quot;)</pre><p>Ready to continue with your exploration? Sure:</p><pre>load(&quot;2015-08-12-df.RData&quot;)</pre><p>Now, go get that break you needed and continue tomorrow ;)</p><p>Enjoy, and keep hacking.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5714ce113727" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Password-less ssh access one-liner]]></title>
            <link>https://medium.com/@mimoralea/password-less-ssh-access-one-liner-77706b8a283d?source=rss-3d2d8215bd6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/77706b8a283d</guid>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Miguel Morales]]></dc:creator>
            <pubDate>Sun, 12 Feb 2017 15:42:00 GMT</pubDate>
            <atom:updated>2017-02-12T15:42:00.388Z</atom:updated>
            <content:encoded><![CDATA[<p>So you are one of the guys that like to use a key pair to access your servers? Are you the one that ssh’s into the server, creates an authorized_keys file under the .ssh folder and places his public key in there?</p><p>Here is a nice short one-liner to do that:</p><pre>ssh root@server &quot;cat &gt;&gt; ~/.ssh/authorized_keys&quot; &lt; ~/.ssh/id_rsa.pub</pre><p>This one-liner will redirect the local public key into the ssh command, which in turn will run the cat to the contents of the redirect and append that into the remote authorized_keys.</p><p>Bottom line, you end up with your local public key authorized in the remote server, thus a password-less access to it.</p><p>Enjoy, and keep hacking.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77706b8a283d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reading Data in R]]></title>
            <link>https://medium.com/@mimoralea/reading-data-in-r-871b4e036142?source=rss-3d2d8215bd6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/871b4e036142</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[r]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Miguel Morales]]></dc:creator>
            <pubDate>Fri, 10 Feb 2017 17:32:03 GMT</pubDate>
            <atom:updated>2017-02-10T17:32:03.904Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the fundamental tasks a data scientist has to perform is loading the data to be analyzed.</p><p>On this recipe, I will demonstrate how to read different formats of data in R. To make this fully reproducible, we will be using some files I collected and uploaded to my site. Check the references section for credits.</p><p>We will show the following formats:</p><ul><li>CSV</li><li>JSON</li><li>XML</li><li>Excel</li><li>Sqlite</li><li>HTML</li></ul><h3>Obtaining the data</h3><pre># create a temp directory and get on it<br>setwd(tempdir())<br>getwd()</pre><p>‘/tmp/RtmpNZTbR1’</p><pre># download file, unzip and clean<br>filename &lt;- &quot;reading-data-r.zip&quot;<br>file_url &lt;- paste(&quot;http://www.mimoralea.com/data&quot;, filename, sep=&quot;/&quot;)<br>download.file(file_url, destfile=filename, method=&quot;curl&quot;)<br>unzip(filename)<br>unlink(filename)<br>local_files &lt;- list.files()<br>local_files</pre><ol><li>‘cl-15–16.json’</li><li>‘grants-2010.xml’</li><li>‘primary_db.sqlite’</li><li>‘stem-2010.xls’</li><li>‘VLO.csv’</li></ol><h3>Reading CSV data</h3><pre>csv &lt;- local_files[grepl(&quot;csv&quot;, local_files)]<br>vlo &lt;- read.csv(csv)<br>head(vlo)<br>summary(vlo)</pre><p>DateOpenHighLowCloseVolumeAdj.Close12015–10–0965.2566.3863.2364.2661970064.222015–10–0864.2566.1464.2365.71482550065.7132015–10–0764.6464.8962.7664.59598930064.5942015–10–0664.5264.8663.163.94621880063.9452015–10–0563.9864.8663.764.58648390064.5862015–10–0261.5263.1260.5363.1496440063.1</p><pre>Date           Open             High              Low<br>1982-01-04:   1   Min.   :  4.50   Min.   :  4.625   Min.   :  4.50<br>1982-01-05:   1   1st Qu.: 18.00   1st Qu.: 18.260   1st Qu.: 17.63<br>1982-01-06:   1   Median : 24.34   Median : 24.625   Median : 24.00<br>1982-01-07:   1   Mean   : 30.22   Mean   : 30.650   Mean   : 29.75<br>1982-01-08:   1   3rd Qu.: 37.74   3rd Qu.: 38.138   3rd Qu.: 37.15<br>1982-01-11:   1   Max.   :116.97   Max.   :117.250   Max.   :114.40<br>(Other)   :8512<br>    Close            Volume           Adj.Close<br>Min.   :  4.50   Min.   :   35800   Min.   : 0.4628<br>1st Qu.: 18.00   1st Qu.:  447725   1st Qu.: 2.1058<br>Median : 24.29   Median : 1630850   Median : 4.2969<br>Mean   : 30.20   Mean   : 4825914   Mean   :13.2348<br>3rd Qu.: 37.65   3rd Qu.: 8267675   3rd Qu.:17.7693<br>Max.   :116.12   Max.   :84719300   Max.   :70.4300</pre><h3>Reading JSON data</h3><pre>json &lt;- local_files[grepl(&quot;json&quot;, local_files)]<br>library(jsonlite)<br>cl &lt;- fromJSON(json)<br>cl[grepl(&quot;FC&quot;, cl),]$shortName</pre><pre>Attaching package: ‘jsonlite’</pre><pre>The following object is masked from ‘package:utils’:</pre><pre>    View</pre><ol><li>“Malmö”</li><li>“Astana”</li><li>“M’gladbach”</li><li>“Juventus”</li><li>“Atlético”</li><li>“CSKA”</li><li>“ManU”</li><li>“Shakhtar”</li><li>“Zenit”</li><li>“Porto”</li><li>“NA”</li><li>“Bayern”</li><li>“Arsenal”</li><li>“Barcelona”</li><li>“BATE”</li><li>“Lyon”</li></ol><h3>Reading XML data</h3><pre>xml &lt;- local_files[grepl(&quot;xml&quot;, local_files)]<br>library(XML)<br>grants &lt;- xmlTreeParse(xml, useInternal=TRUE)<br>rootNode &lt;- xmlRoot(grants)<br>rootNode[[1]]</pre><pre>&lt;Grant AppNumber=&quot;TD-50102-10&quot;&gt;<br>  &lt;ApplicantType&gt;O&lt;/ApplicantType&gt;<br>  &lt;Institution&gt;Center for Independent Documentary, Inc.&lt;/Institution&gt;<br>  &lt;InstCity&gt;Sharon&lt;/InstCity&gt;<br>  &lt;InstState&gt;MA&lt;/InstState&gt;<br>  &lt;InstPostalCode&gt;02067-2868&lt;/InstPostalCode&gt;<br>  &lt;InstCountry&gt;USA&lt;/InstCountry&gt;<br>  &lt;CouncilDate&gt;2009-07-01&lt;/CouncilDate&gt;<br>  &lt;YearAwarded&gt;2010&lt;/YearAwarded&gt;<br>  &lt;ProjectTitle&gt;Mysticism and Monotheism&lt;/ProjectTitle&gt;<br>  &lt;Program&gt;Media Projects Development&lt;/Program&gt;<br>  &lt;Division&gt;Public Programs&lt;/Division&gt;<br>  &lt;ApprovedOutright&gt;65000.0000&lt;/ApprovedOutright&gt;<br>  &lt;ApprovedMatching&gt;0.0000&lt;/ApprovedMatching&gt;<br>  &lt;AwardOutright&gt;65000.0000&lt;/AwardOutright&gt;<br>  &lt;AwardMatching&gt;0.0000&lt;/AwardMatching&gt;<br>  &lt;OriginalAmount&gt;65000.0000&lt;/OriginalAmount&gt;<br>  &lt;BeginGrant&gt;2010-02-01T00:00:00&lt;/BeginGrant&gt;<br>  &lt;EndGrant&gt;2010-08-31T00:00:00&lt;/EndGrant&gt;<br>  &lt;ProjectDesc/&gt;<br>  &lt;ToSupport&gt;Scripting for a two-hour television broadcast and companion website on mystical practice and its contemporary role in Judaism, Christianity, and Islam.&lt;/ToSupport&gt;<br>  &lt;SupplementCount&gt;0&lt;/SupplementCount&gt;<br>  &lt;ParticipantCount&gt;1&lt;/ParticipantCount&gt;<br>  &lt;Participant&gt;<br>    &lt;Firstname&gt;Christine&lt;/Firstname&gt;<br>    &lt;Lastname&gt;Herbes-Sommers&lt;/Lastname&gt;<br>    &lt;Institution&gt;Center for Independent Documentary, Inc.&lt;/Institution&gt;<br>    &lt;City&gt;Sharon&lt;/City&gt;<br>    &lt;State&gt;MA&lt;/State&gt;<br>    &lt;Country&gt;USA&lt;/Country&gt;<br>    &lt;ParticipantTypeID&gt;Project Director&lt;/ParticipantTypeID&gt;<br>    &lt;ValidFr&gt;2009-02-03T07:20:39.360&lt;/ValidFr&gt;<br>  &lt;/Participant&gt;<br>  &lt;DisciplineCount&gt;1&lt;/DisciplineCount&gt;<br>  &lt;Discipline&gt;<br>    &lt;Name&gt;Comparative Religion&lt;/Name&gt;<br>  &lt;/Discipline&gt;<br>&lt;/Grant&gt;</pre><h3>Reading Excel files</h3><pre>xls &lt;- local_files[grepl(&quot;xls&quot;, local_files)]<br>library(xlsx)<br>stem &lt;- read.xlsx(xls, sheetIndex=1, colIndex=c(1:5), rowIndex=c(2:5), header=TRUE)<br>head(stem)</pre><pre>Loading required package: rJava<br>Loading required package: xlsxjars</pre><p>Index.NumberInvestment.NameAgencySubagencyA..Brief.Description1PRG_0001Centers for Ocean Sciences Education Excellence ~National Science FoundationDirectorate for Geosciences (GEO)The Division of Ocean Sciences seeks to establish a network of coordinated centers that will facilitate collaborations and communications between ocean science researchers and educators. These Centers for Ocean Science Education Excellence (COSEE) will foster the integration of ocean research into high quality educational materials, allow ocean researchers to gain a better understanding of educational organizations and pedagogy, provide educators with an enhanced capacity to understand and deliver high-quality educational programs in the ocean sciences, and provide material to the public that will promote a deeper understanding of the ocean and its influence on each person’s quality of life and our national prosperity.2PRG_0002Broadening Participation in Computing (BPC)National Science FoundationDirectorate for Computer &amp; Information Science &amp; Engineering (CISE)The BPC Program was not primarily aimed at education but at the larger issues of recruiting and retaining students from the underrepresented groups in computing: The Broadening Participation in Computing (BPC) program aims to significantly increase the number of U.S. citizens and permanent residents receiving post secondary degrees in the computing disciplines. Initially, its emphasis will be on students from communities with longstanding underrepresentation in computing: women, persons with disabilities, and minorities. Included minorities are African Americans, Hispanics, American Indians, Alaska Natives, Native Hawaiians, and Pacific Islanders. The BPC program seeks to engage the computing community in developing and implementing innovative methods to improve recruitment and retention of these students at the undergraduate and graduate levels. Because the lack of role models in the professoriate can be a barrier to participation, the BPC program also aims to develop effective strategies for identifying and supporting members of the targeted groups who want to pursue academic careers in computing. While these efforts focus on underrepresented groups, it is expected that the resulting types of interventions will improve research and education opportunities for all students in computing.3PRG_0003CISE Pathways to Revitalized Undergraduate Computing Education (CPATH)National Science FoundationDirectorate for Computer &amp; Information Science &amp; Engineering (CISE)Through the CISE Pathways to Revitalized Undergraduate Computing Education (CPATH) program, NSF’s Directorate for Computer and Information Science and Engineering (CISE) is challenging its partners — colleges, universities and other stakeholders committed to advancing the field of computing and its impact — to transform undergraduate computing education on a national scale, to meet the challenges and opportunities of a world where computing is essential to U.S. leadership and economic competitiveness across all sectors of society. The CISE Pathways to Revitalized Undergraduate Education in Computing (CPATH) program also recognizes the growing importance of CT in society. The goals of the program are to: • contribute to the development of a globally competitive U.S. workforce with CT competencies essential to U.S. leadership in the global innovation enterprise; • increase awareness of the strategic importance of undergraduate computing education in a wide range of career fields and disciplinary and interdisciplinary areas; • identify and implement integrative new models for undergraduate computing education that are replicable across a variety of programs and institutions, and have a high probability of adoption on a national scale; • increase the number of students developing CT competencies by infusing CT learning opportunities into undergraduate education in the core computing fields — computer and information science and engineering, and in other fields of study; and, • demonstrate transformative CT-focused undergraduate education models that are replicable across a variety of institutions.CPATH seeks to identify and define the core computing concepts, methods, technologies and tools to be integrated into promising new undergraduate education models, and to demonstrate effective strategies to develop and assess CT competencies in the relevant learning communities. While aimed primarily at revitalizing undergraduate education, CISE encourages the exploration of new models that extend from institutions of higher education into the K-12 environment; activities that engage K-12 teachers and students to facilitate the seamless transition of secondary students into CT-focused undergraduate programs are particularly encouraged.</p><h3>Reading from sqlite database</h3><pre>library(RSQLite)<br>sqlite &lt;- local_files[grepl(&quot;sqlite&quot;, local_files)]<br>conn &lt;- dbConnect(drv=RSQLite::SQLite(), sqlite)<br>tables &lt;- dbListTables(conn)<br>tables<br>dbGetQuery(conn,&quot;SELECT name, summary FROM packages WHERE name like &#39;%py%&#39; LIMIT 5&quot;)<br>lapply(setdiff(tables, &#39;packages&#39;), function(table) dbGetQuery(conn, paste(&quot;SELECT * FROM&quot;, table, &quot;LIMIT 5&quot;)))</pre><pre>Loading required package: DBI</pre><ol><li>‘conflicts’</li><li>‘db_info’</li><li>‘files’</li><li>‘obsoletes’</li><li>‘packages’</li><li>‘provides’</li><li>‘requires’</li></ol><p>namesummary1mlt-pythonPython package to work with MLT2k9copyVideo DVD backup and creation program3python-MythTVPython bindings for MythTV4python-swftoolsPython bindings for swftools5vobcopyUtility to copy DVD .vob files to disk</p><ol><li>nameflagsepochversionreleasepkgKey1audacityNANANANA832VirtualBox-guestLE04.3.281.fc221043totemNANANANA1634kernel-debug-develNANANANA2715VirtualBoxLE04.3.281.fc22415</li><li>dbversionchecksum110ddf0827190089af87e19c1a3e33c2ba35b85fb75a84d4ec8fc9ce29cd84b1aab</li><li>nametypepkgKey1/etc/rpm/macros.live555file12/usr/bin/vlc-wrapperfile23/usr/bin/vlcfile24/usr/bin/rvlcfile25/usr/bin/nvlcfile2</li><li>nameflagsepochversionreleasepkgKey1live-develLT000.19.2008.04.0312vlc-noxLT01.1.5223y4mscalerLT09.014104xbmc-develLT014.0NA175xbmc-eventclients-develLT014.0NA41</li><li>nameflagsepochversionreleasepkgKey1live555-devel(x86–64)EQ02014.10.211.fc2212live555-develEQ02014.10.211.fc2213live-develEQ02014.10.211.fc2214config(live555-devel)EQ02014.10.211.fc2215vlc-noxEQ02.2.16.fc222</li><li>nameflagsepochversionreleasepkgKeypre1live555(x86–64)EQ02014.10.211.fc221FALSE2rtld(GNU_HASH)NANANANA2FALSE3live555(x86–32)EQ02014.10.21NA2FALSE4libzvbi.so.0NANANANA2FALSE5libz.so.1(ZLIB_1.2.0.2)NANANANA2FALSE</li></ol><h3>Reading HTML data</h3><pre>website &lt;- &quot;http://www.realmadrid.com/&quot;<br>page &lt;- htmlTreeParse(website, useInternal=TRUE)<br>xpathSApply(page, &quot;//div[@class=&#39;m_schedule m_widget&#39;]/ul//li&quot;, xmlValue)</pre><ol><li>‘ Liga BBVA 17–10–2015–16:00 Real Madrid Levante Por: C+ Liga ENTRADAS ‘</li><li>‘ Champions League 21–10–2015–20:45 Paris Saint-Germain Real Madrid Por: Bein Sports ‘</li><li>‘ Liga BBVA 24–10–2015–16:00 Celta de Vigo Real Madrid Por: C+ Liga ‘</li></ol><h3>References</h3><p><a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/tempfile.html">https://stat.ethz.ch/R-manual/R-devel/library/base/html/tempfile.html</a> — Create Names for Temporary Files</p><p><a href="https://class.coursera.org/getdata-033/">https://class.coursera.org/getdata-033/</a> — Getting and Cleaning Data</p><p><a href="https://stat.ethz.ch/R-manual/R-devel/library/utils/html/download.file.html">https://stat.ethz.ch/R-manual/R-devel/library/utils/html/download.file.html</a> — Download File from the Internet</p><p><a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/file.path.html">https://stat.ethz.ch/R-manual/R-devel/library/base/html/file.path.html</a> — Construct Path to File</p><p><a href="http://api.football-data.org/index">http://api.football-data.org/index</a> — Soccer data JSON sample</p><p><a href="http://finance.yahoo.com/q?s=VLO">http://finance.yahoo.com/q?s=VLO</a> — Yahoo Finance data CSV sample</p><p><a href="https://stat.ethz.ch/R-manual/R-devel/library/utils/html/unzip.html">https://stat.ethz.ch/R-manual/R-devel/library/utils/html/unzip.html</a> — Extract or List Zip Archives</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=871b4e036142" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Docker on Fedora 23]]></title>
            <link>https://medium.com/@mimoralea/installing-docker-on-fedora-23-defc8524e6a6?source=rss-3d2d8215bd6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/defc8524e6a6</guid>
            <category><![CDATA[fedora]]></category>
            <category><![CDATA[fedora-linux]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Miguel Morales]]></dc:creator>
            <pubDate>Sat, 04 Feb 2017 19:47:01 GMT</pubDate>
            <atom:updated>2017-02-04T19:47:01.026Z</atom:updated>
            <content:encoded><![CDATA[<p>So, for some reason every time I have to install Docker on Fedora I get a couple of bumps along the way. So, I wanted to leave a brief tip on how to get it installed without permission issues and without having to log out of the system. Here we go:</p><p>First, rather obvious, you have to install the package:</p><pre>sudo dnf -y install docker-io</pre><p>Next, lets add a docker group so you don’t have to run sudo every time you use the docker cli:</p><pre>sudo groupadd docker</pre><p>Now, add your user to the docker group:</p><pre>sudo usermod -aG docker $USER</pre><p>Here is a little trick so you don’t have to login and out… I’m assuming you use your default group as primary group, that is the name of your primary group is the name of your user. If you are not sure run groups $USER to verify.</p><pre>newgrp docker<br>newgrp $USER <em># or whatever your primary group is</em></pre><p>Now, finish up the installation by enabling (if you want docker to start automatically during boot) and starting the docker daemon:</p><pre>sudo systemctl enable docker<br>sudo systemctl start docker</pre><p>Finally, verify your installation:</p><pre>docker run hello-world</pre><p>Now, the group thing was kinda hacky, so make sure you log out and back in, eventually.</p><p>Meanwhile keep hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=defc8524e6a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Minimalist Deep [Reinforcement] Learning Hardware]]></title>
            <link>https://medium.com/@mimoralea/minimalist-deep-reinforcement-learning-hardware-3f16f019a32f?source=rss-3d2d8215bd6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f16f019a32f</guid>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[computers]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <dc:creator><![CDATA[Miguel Morales]]></dc:creator>
            <pubDate>Thu, 02 Feb 2017 21:17:00 GMT</pubDate>
            <atom:updated>2017-02-02T21:17:00.486Z</atom:updated>
            <content:encoded><![CDATA[<h3>UPDATE:</h3><p><strong>Dec, 20th 2016:</strong> I guess you can call me crazy. I ended up buying a couple of additional parts and replacing the previously installed. Wanna know what?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*znur9S5KELeSyCaZ.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FSdH9lte-pezUAAl.jpg" /></figure><p>And, I also got a couple of these:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UE_R8KkjRfxx_jlA.jpg" /></figure><p>And 2 x 1 TB Barracuda Hard Drives.</p><p>Oh, and by the way, I bought a second Titan X. Merry Christmas!</p><p>So, now the machine has:</p><ul><li>4 x 500GB SSD (instead of 4 x 120GB SSD)</li><li>2 x 1TB HD (instead of 2 x 500GB SSD)</li><li>2 x Titan X</li></ul><p>I quickly came to the problem of storage with the previous setup. I started processing video for the self-driving car Nanodegree, and only downloading the data got me close to the limit.</p><p>Regarding the GPUs, I made the change from the 2 x 980’s to the Titan X (Pascal) after reading and comparing performances. Selling the 2 x 980’s cover almost 3/4 of the cost of the Titan X, and performance boost was big. Tasks that would normally take me few days of training, can be now measured in hours. In fact, a <a href="https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/5_MultiGPU/multigpu_basics.py">script</a> that I ran to measure the boost of the dual GPU on the previous setup was ~11 to ~8 seconds from single to dual GPU respectively. With the Titan X, it took ~5 seconds with a single GPU. Since I’m experimenting with Deep Learning heavily, I decided to go for the second Titan X as an investment. With the 2 x Titan X setup, I now get ~2 seconds for the same test.</p><p>Anyhow, I thought to share in case someone can benefit from my experimentations.</p><p>I’ll be posting about my software stack setup a bit later, make sure to check that out as well.</p><h3>Intro</h3><p>So after having some fun building <a href="https://github.com/mimoralea/king-pong">King-Pong</a>, and having to actually wait for that fun while training its NN, I decided to step it up a bit and build a system that is overall efficient. I like concise solutions; that is solutions that solve a problem with a minimum amount of fluff. Not for any reason I drive a <a href="https://www.google.com/search?q=scion+iq&amp;espv=2&amp;biw=1278&amp;bih=803&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ved=0ahUKEwjNj5XZyrXPAhVMSCYKHQf7Bd4Q_AUIBigB">Scion IQ</a>, or type on a <a href="https://www.google.com/search?q=happy+hacking+keyboard&amp;biw=1278&amp;bih=803&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;sqi=2&amp;ved=0ahUKEwjJlfj0yrXPAhUC4iYKHf12AfEQ_AUIBygC">Happy Hacking Keyboard</a>, just to mention a few.</p><p>For this reason, <a href="http://pcpartpicker.com/user/mimoralea/saved/#view=N9KZLk">I built a ~$1,500 machine for doing Deep Learning</a>. I selected a Mini tower with everything necessary and nothing extra.</p><p>Ready for the breakdown? Here we go:</p><h3>Parts</h3><h3>Motherboard</h3><p>For the motherboard I went with Asus ROG MAXIMUS VIII GENE. Reason why:</p><ul><li>Cost effective, at about $200 there is very little competetion.</li><li>4 slots for RAM which is more than enough.</li><li>USB 3.0 and 3.1.</li><li>LGA1151, sure it’s not compatible with 40 lane CPU’s, but <a href="https://www.youtube.com/watch?v=rctaLgK5stA">I would argue it’s not a problem</a></li><li>6 SATA 6Gb/s</li></ul><h3>Processor</h3><p>For the processor I selected an <strong>Intel Core i5 6600K 3.50 GHz</strong>. It is really the best bang for the buck. Also, remember that a faster processor would probably not make an impact on your Deep Learning tasks. Higher speed are really only necessary if you will be doing video editing or perhaps running multiple virtual machines. But remember, we are keeping this build simple.</p><h3>Memory</h3><p>I went with the <strong>Kingston HyperX FURY Black 32GB Kit</strong>. Sure, that was a little greedy, I have to agree there. Maybe we call this build <a href="https://en.wikipedia.org/wiki/Multi-armed_bandit#Semi-uniform_strategies">Epsilon-Greedy</a>?</p><h3>GPU</h3><p>For the GPU I chose to go with 2 x <strong>MSI GAMING GeForce GTX 980 4GB OC</strong>. I bought these second hand in very good condition.</p><p>Now, am I happy with them?</p><p>I can say that I would prefer getting only 1. I check the speed improvements on multi-gpu setup and the improvement from 1 to 2 is very minimal. In fact, a recent <a href="https://research.googleblog.com/2016/04/announcing-tensorflow-08-now-with.html">blog post</a> by Google Research shows this graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/0*Tg66q4lhGFolQarJ.png" /></figure><p>For this reason, I would actually recommend getting a better card, E.g. GTX 1080 instead, you’ll be paying a little for double the RAM capacity.</p><h3>Case</h3><p>I got the <strong>Cooler Master Silencio 352</strong> to host all of these components. I’m very happy with it, it is silent enough. Though, if you are looking for a totally silent built, this might not be the best bet.</p><p>Also, I had to remove a couple of things to make everything fit nicely. I added some pictures so you guys can save some time.</p><h3>PSU</h3><p>For the PSU, I got one of the highest quality. In terms of capacity, this is sufficient for this build: <strong>EVGA SuperNOVA 850 P2, 80+ PLATINUM 850W</strong>.</p><h3>CPU FAN</h3><p>Long time I don’t buy a CPU, didn’t know that you had to buy the cooler separatedly! Anyhow, the <strong>Corsair Hydro Series H100i v2 Extreme Performance Liquid CPU Cooler</strong> proved to be excellent.</p><h3>Storage</h3><p>I bought 6 SSD drives with the intention to put them on a RAID 10 array. Maybe a lot faster than needed, but I wanted to make sure I gain speed and at the same time I have failure tolerance. Now, I’ll be putting these RAID 10 on the motherboard so even the boot partition should be on top of several drives. I went with <strong>6 x Samsung 840 EVO 120GB</strong>.</p><h3>Others</h3><p>Here are some other things that I got for finishing the build:</p><ul><li><strong>ICY DOCK FLEX-FIT Quattro MB344SP</strong> — The case allows you to put 4 drives. This add-on is basically a DVD-to-4-ssd. Very easy to install.</li><li><strong>LG 29UM68-P 29-Inch 21:9 UltraWide IPS Monitor</strong> — Yeah, yeah, a weird ratio, but for using <a href="https://www.archlinux.org/">Arch Linux</a> and <a href="http://i3wm.org/">I3</a> is amazing! And yeah, only 1 monitor. I don’t believe in “multi-tasking”. I believe in focus.</li><li><strong>AmazonBasics Single Monitor Display Mounting Arm</strong> — Honestly, the best monitor arm I ever owned.</li></ul><h3>Build</h3><p>Got most of the parts at the same time. To be fair, I already had some of the drives and one of the GPUs. Here is a pic of the first delivery:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0lQgNZzSJRaEKNYq.jpg" /></figure><p>Later that week I got the other used GPU. Obviously, I didn’t want to try anything different so I went with the exact model I already had:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0iI0LUnY4TrZRhPy.jpg" /></figure><p>Here, I started building the system. First open up the mother board:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3Ys0Y6ttq8i5Xntn.jpg" /></figure><p>Put the memory in:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B2HUwybPuqDTr2TN.jpg" /></figure><p>Now, I started to mess with the case. Here I inserted the CPU Cooler, this was rather challenging to fit. One manual recommended to attach the fan on the outside, the other on the inside. I went with the outside first, but then the front cover would not close. At the end, I put the fans on the inside. Here is a pic of the cooler:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EqSW9HQ45D8XXU-6.jpg" /></figure><p>What, you tired already?? We just getting started!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D7a28vnDsSq5rVxQ.jpg" /></figure><p>Here I inserted the MB into the case. Tight fit!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gfm0wHwaQqvpmsFG.jpg" /></figure><p>Place the GPUs inside:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5cUw9ekLMKCdGqvT.jpg" /></figure><p>Yeah, she is done:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JcSTcnGkM_sf8fvZ.jpg" /></figure><p>Later, I got the accessory for the extra drives. I really liked this one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EvUKLm2vy0HJ8JQp.jpg" /></figure><p>I got 4 drives here and 2 inside. Helps with the clutter. After all, who in the world uses DVD drives anymore?! :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_ioicQIdBveggZRd.jpg" /></figure><p>Look at it. There you can see the PSU too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QGFc5ZDrN-CmE848.jpg" /></figure><p>It was a nice build.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_RRTLD5csJgWL0KZ.jpg" /></figure><p>Oh yeah, the case… This is how the final product looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hmQ1GoWnIOIK-gK0.jpg" /></figure><h3>References</h3><ul><li><a href="http://timdettmers.com/2014/08/14/which-gpu-for-deep-learning/">Tim Dettmers — Which GPU(s) to Get …</a></li><li><a href="http://timdettmers.com/2015/03/09/deep-learning-hardware-guide/">Tim Dettmers — A Full Hardware Guide …</a></li><li><a href="http://timdettmers.com/2014/09/21/how-to-build-and-use-a-multi-gpu-system-for-deep-learning/">Tim Dettmers — How To Build and Use a Multi GPU …</a></li><li><a href="http://graphific.github.io/posts/building-a-deep-learning-dream-machine/">Roelof Pieters — Building a Deep Learning …</a></li><li><a href="http://www.kdnuggets.com/2016/06/build-deep-learning-box.html">Hui Han Chin — How to Build Your Own Deep …</a></li><li><a href="https://www.youtube.com/user/LinusTechTips">LinusTechTips — Several Videos, highly recommended.</a></li></ul><h3>Conclusion</h3><p>It was a fun build, I’m typing on it now. Tensorflow works well. The extra GPU is really not that good I get an improvement of about 20 seconds on a 8 minute task. I wouldn’t get the second GPU.</p><p>Join me next time I’ll be installing a minimalist OS, Arch Linux with I3, Emacs, Vim, Tensorflow and so on. Remember, only the necessary.</p><p>See you next time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f16f019a32f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[But, Self-Driving Car Engineers don’t need to know C/C++, right?]]></title>
            <link>https://medium.com/@mimoralea/but-self-driving-car-engineers-dont-need-to-know-c-c-right-3230725a7542?source=rss-3d2d8215bd6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3230725a7542</guid>
            <category><![CDATA[c]]></category>
            <category><![CDATA[parallel-computing]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <dc:creator><![CDATA[Miguel Morales]]></dc:creator>
            <pubDate>Tue, 31 Jan 2017 02:02:01 GMT</pubDate>
            <atom:updated>2017-01-31T02:02:01.020Z</atom:updated>
            <content:encoded><![CDATA[<p>According to <a href="https://www.paysa.com/salaries/self-driving-car-engineer--t">Paysa.com</a>, over 90% of the applicants need to know C++, and over 70% need to know C. But, I feel your pain. I, too, came out of school knowing C/C++ right into a web/app development shop. I spent way too much time using other languages and only recently started brushing up my memory allocation. Did you get that?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*s6ppR_nTzYVp4FLEtDcM_Q.png" /></figure><p>In this post, I intent to do an in-depth review on how is C/C++ utilized when solving Self-Driving Car problems. I do this after reviewing over many Self-Driving Car job postings for a couple of weeks. I compiled all the most common technological requirements, and all the common algorithms asked for. I then looked for common tools in which they intersect. Additionally, I looked into <a href="https://medium.com/u/2929690a28fb">Udacity</a>’s Self-Driving Car Nanodegree second term syllabus for cross-reference.</p><p>What the difference between C and C++? You may ask. Even, what is the difference between C, C++ and C/C++. The answer to this question can be surprising. C is actually not the same language than C++, but because you can use C++ to write C code, the C++ language is commonly referred to as C/C++. Note, however, that many <a href="http://www.cio.com/article/2374346/developer/linus-torvalds--why-c---sucks.html">top class C developers despise C++</a> code. Often referring to it as bloated and the cause of bad design choices. Now, take this for what is worth, remember the Linux kernel is all written in pure C and a subset of assembly, and it is well know as a high-performance operating system. However, there are lots of applications that are written in C++ and still perform very well. I’ll be referring to C++ as C/C++ only to include both. If there is a need to make a distinction, I’ll do so.</p><h4>How will you use C/C++ as a Self-Driving Car Engineer?</h4><p>The C and the C++ programming languages are both well known for speed. Many of the applications that are either real-time or that use a parallel architecture are written in C/C++. For example, look at <a href="http://jobs.corporate.ford.com/ShowJob/Id/837415/Embedded%20Systems%20Engineer%20%20%20Autonomous%20Driving">this</a> job posting, see the need for RTOS, CUDA, Computer Vision. All of these should come to you as C/C++. Also, take a quick look at <a href="http://search.lockheedmartinjobs.com/ShowJob/Id/64022/R%20D%20Engineer%20%20%20Robotics%20%20%20Intelligent%20Systems">this one</a>. See ROS? Well, I bet this will be ROS with the C/C++ programming interface. Look at <a href="https://www.indeed.com/viewjob?jk=3009751578839228&amp;q=autonomous+vehicle&amp;tk=1b7mccd35549v89u&amp;from=web">this one</a> too. See the real-time constraints? Yeah, that is C/C++ right there.</p><p>This is just a sample set, but it generalizes well. Self-Driving Car Engineers use C/C++ to squeeze as much speed out of the machine as possible. Remember, all processing in autonomous vehicles is done in real-time and even sometimes in parallel architectures, so you will have to learn to code for the CPU but also the GPU. It is vital for you to deliver software that can process large amount of images (think about the common fps — 15, 30 or even 60) every second.</p><p>Now, knowing the language is not enough. Often top C/C++ developers say that badly written C/C++ code can perform worse that a well written piece of Java. However, if you learn some good optimizations techniques you should be able to write high-quality, high-performance code. That should be your goal if you are looking to get yourself a Self-Driving Car Engineer position.</p><p>Now that I put forth some of the reasons why it is a good idea for you to learn C/C++, let’s go into more detail regarding the tools and libraries that you will most likely be coding against in this language. Make sure to check the references section for a list of the books I’ve been reading recently and that I recommend.</p><h4>ROS</h4><p>Robot Operating System (ROS) is not an Operating System. I know, weird. ROS is a framework composed of tools and libraries for writing robot software. The ROS framework can be easily installed on Ubuntu, and you can be up and running in no time.</p><p>One of the reasons ROS is used for developing self-driving cars is its design conventions. ROS helps you implement modular and distributed code by using a Publisher and Subscriber architecture. Additionally, ROS was created with open-source in mind, so lots of implementation of the most common algorithms use in robotics are readily available for you to use or modify. You can find Kalman Filters, Particle Filters, Lane detection pipelines, etc.</p><p>You can actually use other programming languages to leverage ROS libraries, packages and tools, but most of the production code will be written in C/C++ so make sure to review it.</p><p>The following is a ROS “Hello World” example:</p><pre>#include &lt;ros/ros.h&gt;<br><br><strong>int</strong> main(<strong>int</strong> argc, <strong>char</strong>** argv) {<br>  ros::init(argc, argv, &quot;hello_world&quot;);<br>  ros::NodeHandle nh;<br>  ROS_INFO_STREAM(&quot;Hello, world!&quot;);<br>}</pre><p>I read the book “A Gentle Introduction to ROS” by Jason M. O’Kane, and I can definitely recommend.</p><h4>CUDA</h4><p>Most of the time code is written for the CPUs to do the computations. However, sometimes it is the GPU, a Graphical Processing Unit, that computes. Here is the thing, CPUs are really good at doing sequential work, that is, one thing at a time, even if you have multiple threads. They are just extremely fast. So fast, that to give the illusion of processing multiple things at once. However, there is this other processing unit that is optimized for parallel processing. For a very long time now, few great companies have been pleasing games appetite creating faster and sharper gaming experiences every year. Little we knew that the same processing units optimized to update many many pixels at the same time in order to create a realistic gaming experience would be later used to speed up Deep Learning algorithms. Yes, thank you gamers!</p><p>CUDA is a library that you can use to create parallel code. Again, there are other programming languages that can leverage the power of CUDA and GPUs, however, it’ll be C/C++ what will go into the live system. Make sure to learn your bit of CUDA C. Remember matrix multiplication from college? Well, that can be made into parallel code with CUDA C. Actually, lots of image pre-processing techniques as well as deep learning computations can leverage the power of GPUs.</p><p>Here is the corresponding CUDA “Hello World” example by <a href="http://www.nvidia.com/docs/IO/116711/sc11-cuda-c-basics.pdf">Cyril Zeller</a>:</p><pre>__global__ <strong>void</strong> mykernel(<strong>void</strong>) {<br>}<br><br><strong>int</strong> main(<strong>void</strong>) {<br>  mykernel&lt;&lt;&lt;1,1&gt;&gt;&gt;();<br>  printf(&quot;Hello World!\n&quot;);<br>  <strong>return</strong> 0;<br>}</pre><p>The book I can recommend if you are interested in learning more about CUDA and parallel programming is “Professional CUDA C Programming” by John Chen et al.</p><h4>RTOS (Real-Time Operating Systems or just real-time programming)</h4><p>There is often confusion when someone refers to an RTOS. RTOS literally means Real-time Operating System, however, often time people just mean an application that must respond to events as data comes in. The responses of these systems are often required on a time constraint, say 10 ms, 50 ms, or 100 ms. However, this often does not need to be constraint to a specific operating system. Let me put it this way, Linux is not a real-time operating system, however, it is often used for real-time applications.</p><p>This being said, there are other operating systems that are consider real-time, like QNX and VxWorks, and there are some architectural decision and coding principles that you might want to know when implementing solutions with very tight time requirements.</p><p>For brushing up your RTOS skills I would recommend 2 things. First, go get a book about the Linux kernel. I can recommend “Linux Kernel Development (3rd Edition)” by Robert Love. This will help you understand operating systems in general. The process management and scheduling, timers, memory management and so on, are very important to the speed of real-time applications. Then, go and get a book on Real-Time Systems. I can recommend “Real-Time Systems Design and Analysis: Tools for the Practitioner 4th Edition” by Phillip A. Laplante et al. This book will show you not only the foundations, architecture and details of RTOS, but it also goes into programming best practices, requirements engineering and other software development processes as it related to RTOS.</p><h4>OpenCV</h4><p>I’ve used lot of OpenCV but I often use Python instead of C/C++. It is important for you to know that OpenCV also has C/C++ bindings. So, a very likely workflow as a self-driving car engineer will be to prototype a pipeline for image pre-processing using Python and OpenCV, polish it, and then translate it into C/C++ code. Make sure to at least use the OpenCV C/C++ bindings a couple of time before you go into an interview.</p><h4>Deep Learning</h4><p>I know, Deep Learning is not a “library”. But I just wanted to mention this here because there most of the deep learning libraries out there are coded with C/C++ and only have APIs available for you to call in some of the other languages like Python, for example. It might be the case, that you will be asked to prototype your deep learning pipelines in something like Keras, but then move it to either TensorFlow C++ or even CUDA C, though this last one might be a stretch. So, learn to use TensorFlow C++ API before you apply!</p><p>The Self-Driving Car train is just around the corner (Did you get it?), do not waste this opportunity to become the greatest you. Work really hard every day to become the best C/C++ software engineer you can, and you will be one step closer to becoming a Self-Driving Car Engineer.</p><p>If you like this posts, subscribe. I’m planning to add a couple more posts regarding other programming languages and tools. Most of my post will be related to Self-Driving Cars, Deep Learning and Reinforcement Learning. Also, leave a comment if you have any questions or suggestions. And good luck to you!</p><h3>References</h3><ul><li>A Gentle Introduction to ROS by Jason M. O’Kane</li><li>Professional CUDA C Programming by John Chen et al.</li><li>Linux Kernel Development (3rd Edition) by Robert Love.</li><li>Real-Time Systems Design and Analysis: Tools for the Practitioner 4th Edition by Phillip A. Laplante et al.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3230725a7542" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Minimalist Deep [Reinforcement] Learning Software]]></title>
            <link>https://medium.com/@mimoralea/minimalist-deep-reinforcement-learning-software-c1d7c4fe8bf3?source=rss-3d2d8215bd6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1d7c4fe8bf3</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[arch-linux]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Miguel Morales]]></dc:creator>
            <pubDate>Sat, 28 Jan 2017 22:17:00 GMT</pubDate>
            <atom:updated>2017-02-28T15:25:08.090Z</atom:updated>
            <content:encoded><![CDATA[<h3>Intro</h3><p>On this post, I’ll be showing you how to install Arch Linux with i3 windows manager. Yep, that’s it, not DE, minimalist, remember?</p><p>Quick note is, the screenshots and disk sizes might not be consistent, this is OK, the thing is, I took the screenshots when I was building the system with a specific configuration, and then I rebuilt it shortly after with a little larger drives.</p><p>If you have any questions, feel free to ask!</p><p>We will be building the system on a 2 RAID configuration:</p><ul><li>RAID 10 (mirror+striping): 4 x 500 GB SSD.</li><li>RAID 0 (striping): 2 x 1 TB HD.</li></ul><p>The first RAID will host the OS, which will be Arch Linux. We will let the motherboard software handle the RAIDs so that we can rely on it for drives failure. I’ve found a lot of conflicts when trying to use Linux software RAID like mdadm to create a RAID of the whole disk and a (redundant) boot partition off it, but doing this with the Intel controller works well for me. The system will be able to boot even is a disk fails and will also take advantage of the multi disk config by speeding up 4x the reads and 2x the writes.</p><p>The second RAID is where we will put the deep learning data, so since we do not care about keeping this data redundant (as this is online accessible data), we are going to setup a striping array on this set of disks. Basically, we will use the full 2 TB of space available, and also gain a 2x speed up in both reads and writes. Not too shabby!</p><h3>Set up the disk as software RAID from your motherboard</h3><p>This is a somewhat important step. Remember, we are building the array on the motherboard software, before the OS. This is how the BIOS would look like after setting up the 2 arrays:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ACds_ifpBG6C5h7C.jpg" /></figure><p>Now, remember that this is a screenshot of my old setup. However, if you follow the prompts on your system, it should be pretty straight-forward to get through this part.</p><h3>Create your partitions</h3><p>OK, so I’m assuming you created your Arch Linux boot pen drive and booted on it.</p><p>Now, you can take a look at the disks detected by your system with:</p><pre>fdisk --list</pre><p>Make note of the RAID partitions that will show up. In my case “md124” was the OS, and “md125” was the data array.</p><p>Now, let’s briefly make sure you have network access and set the correct time:</p><pre>ping archlinux.org<br>timedatectl set-ntp true</pre><p>Next, we will create the partitions as follows:</p><pre><em># partition 1 - 100MB EFI -&gt; Hex code ef00</em><br><em># partition 2 - 500MB Boot -&gt; Hex code 8300</em><br><em># partition 3 - 100% remaining on disk linux -&gt; Hex code 8300</em><br>gdisk /dev/md124<br><em># partition 1 - 100% disk -&gt; Hex code 8300</em><br>gdisk /dev/md125</pre><p>Now, that the partitions are created, we create the “lvm” volume groups, and logical volumes:</p><pre>vgcreate os /dev/md124p3<br>vgcreate data /dev/md125p1<br><em># create the volumes on top of the OS array</em><br>lvcreate --size 16GB os --name swap<br>lvcreate --size 60GB os --name root<br>lvcreate -l +100%FREE os --name home<br><em># create the volume where the working data will reside</em><br>lvcreate -l +100%FREE data --name srv<br><em># visualize partitions and volumes</em><br>lvdisplay</pre><p>Next, we format all of the partitions created:</p><pre><em># EFI and boot partitions</em><br>mkfs.vfat -F32 /dev/md124p1<br>mkfs.ext2 /dev/md124p2<br><em># system partitions</em><br>mkswap /dev/mapper/os-swap<br>mkfs.ext4 /dev/mapper/os-home<br>mkfs.ext4 /dev/mapper/os-root<br><em># data partition</em><br>mkfs.ext4 /dev/mapper/data-srv</pre><p>Now, we mount the system to start the installation of the OS:</p><pre><em># mount root and boot partitions</em><br>mount /dev/mapper/os-root /mnt<br>mkdir /mnt/boot<br>mount /dev/md124p2 /mnt/boot<br>mkdir /mnt/boot/efi<br>mount /dev/md124p1 /mnt/boot/efi<br><em># mount os partitions</em><br>mkdir /mnt/srv<br>mkdir /mnt/home<br>mount /dev/mapper/os-home /mnt/home<br>mount /dev/mapper/data-srv /mnt/srv<br><em># enable swap partition</em><br>swapon /dev/mapper/os-swap</pre><p>We now install the base system on the mounted partitions, generate the fstab, copy some config files from the USB stick and chroot our new system:</p><pre><em># this installs some base packages to make our system usable</em><br>pacstrap /mnt base base-devel grub-efi-x86_64 vim git efibootmgr zsh<br><em># generate the fstab so that our system can find the partitions on boot</em><br>genfstab -pU /mnt &gt;&gt; /mnt/etc/fstab<br><em># copy the prompt config from the USB stick - I really like the installer&#39;s config</em><br>rsync -av /root/ /mnt/root/<br>rsync -av /etc/zsh/ /mnt/etc/zsh/<br><em># get into the new system</em><br>arch-chroot /mnt /bin/zsh</pre><p>Cool! You are now inside of your new system — treat it nicely.</p><p>Let’s do some initial configuration to make the system par to most standard Linux distributions.</p><pre>ln -fs /usr/share/zoneinfo/America/Chicago /etc/localtime<br>hwclock --systohc --utc<br><em># my hostname is hash - make this whatever you want yours to be</em><br>echo hash &gt; /etc/hostname<br>hostname hash<br>vi /etc/hosts <em># make sure you add your hostname to this too</em><br><em># this is the root password... set that now</em><br>passwd<br><em># add your user, mine is mimoralea with group wheel... make this whatever you&#39;d like</em><br>useradd -m -g users -G wheel mimoralea<br>passwd mimoralea<br><em># set some language variables</em><br>echo LANG=en_US.UTF-8 &gt;&gt; /etc/locale.conf<br>echo LANGUAGE=en_US &gt;&gt; /etc/locale.conf<br>echo LC_ALL=C &gt;&gt; /etc/locale.conf<br>export LANG=&quot;en_US.UTF-8&quot;<br>echo &quot;en_US.UTF-8 UTF-8&quot; &gt;&gt; /etc/locale.gen <br>locale-gen <br>echo LC_COLLATE=&quot;C&quot; &gt;&gt; /etc/locale.conf<br>echo KEYMAP=&quot;us&quot; &gt;&gt; /etc/vconsole.conf<br>echo FONT=&quot;eurlatgr&quot; &gt;&gt; /etc/vconsole.conf<br><em># update pacman&#39;s database and install some new packages</em><br>pacman -Sy --noconfirm<br>pacman -S --noconfirm grub linux-headers os-prober intel-ucode dosfstools efibootmgr<br>mdadm --detail --scan &gt;&gt; /etc/mdadm.conf</pre><p>Let’s edit the grub file and change some variables:</p><pre>vi /etc/default/grub <em># uncomment GRUB_DISABLE_LINUX_UUID=true</em></pre><p>Since we added mdadm arrays (the OS sees the motherboard created arrays as regular mdadm’s), let’s make a few changes to the mkinitcpio files.</p><pre>sed -i.bak -r &#39;s/^HOOKS=(.*)block(.*)/HOOKS=\1block mdadm_udev lvm2\2/g&#39; /etc/mkinitcpio.conf <br><em># BROKEN: sed -i.bak -r &#39;s/^BINARIES=&quot;&quot;/BINARIES=&quot;/sbin/mdmon&quot;/g&#39; /etc/mkinitcpio.conf</em></pre><p>The last command marked as BROKEN is broken, surprise! If you know how to write that sed line please let me know in a comment below :)</p><p>But in any case, make sure you change the line BINARIES=&quot;&quot; for BINARIES=&quot;/sbin/mdmon&quot;. Do it manually or let me know!</p><p>After you make those 2 changes, execute the following commands to get grub installed:</p><pre>mkinitcpio -p linux<br>grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug /dev/md/os_0<br>grub-mkconfig -o /boot/grub/grub.cfg<br><em># these two lines are a trick for some systems that look for the EFI files on a different directory.</em><br><em># we might not need them, but it does hurt to have them</em><br>mkdir /boot/efi/EFI/boot<br>cp /boot/efi/EFI/arch_grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi</pre><p>We can now get off this new system umount, disable the swap partition and reboot:</p><pre>exit<br><em># we are now back on the installer</em><br>umount -R /mnt<br>swapoff -a<br>reboot</pre><p>Remove the pen drive and go get a cup of coffee. I’ll see you in few minutes…</p><p>Alright, let’s login and immediatelly give your user sudo access:</p><pre><em># login as root</em><br>su<br><em># and uncomment the line that would allow wheel users to sudo</em><br>visudo</pre><p>Now, let’s setup your network connectivity:</p><pre><em># still as root let&#39;s setup the network connection</em><br>ip addr   <br><em># my device is &#39;enp0s31f6&#39;</em><br>cp /etc/netctl/examples/ethernet-dhcp /etc/netctl/enp0s31f6<br><em># not sure if we need this one (don&#39;t remember)</em><br><em># but -rf would fail silently</em><br>rm -rf /etc/netctl/eth0 <br><em># now edit this file to make your device look as needed</em><br>vi /etc/netctl/enp0s31f6 <br><em># let&#39;s get online!</em><br>netctl list<br>netctl start enp0s31f6<br>netctl enable enp0s31f6</pre><p>We want to be able to use yaourt to download our packages. We trust the community! Let’s do so:</p><pre>echo &#39;&#39; &gt;&gt; /etc/pacman.conf <br>echo &#39;[archlinuxfr]&#39; &gt;&gt; /etc/pacman.conf <br>echo &#39;SigLevel = Never&#39; &gt;&gt; /etc/pacman.conf <br>echo &#39;Server = <a href="http://repo.archlinux.fr/$arch&#39;">http://repo.archlinux.fr/$arch&#39;</a> &gt;&gt; /etc/pacman.conf <br>pacman -Sy yaourt</pre><p>Let’s get out of sudo, and install some more packages:</p><pre><em># get out of su</em><br>exit<br>yaourt -S --noconfirm nvidia nvidia-utils cuda i3 i3-wm \<br>i3status i3lock xterm dmenu xorg xorg-xinit termite \<br>chromium emacs franz-bin i3blocks rsync wget curl nitrogen \<br>vlc terminus-font</pre><p>Now, I’m not going into the details how I personally setup my i3, but I give you a couple of tips:</p><pre><em># this command executes i3 once the xinitr is started</em><br>echo &#39;exec i3 -V &gt;&gt; ~/.config/i3/i3log 2&gt;&amp;1&#39; &gt;&gt; ~/.xinitr<br><em># this one adds a X session when a bash session is added</em><br>echo &#39;[ -z &quot;$DISPLAY&quot; -a &quot;$(fgconsole)&quot; -eq 1 ] &amp;&amp; exec startx&#39; &gt;&gt; ~/.bash_profile</pre><p>Also, if you have never used i3 you’ll freak out when you see the default fonts!!OMG! Worry-not, you can fix this with:</p><pre>yaourt -S --noconfirm adobe-source-code-pro-fonts  \<br>adobe-source-sans-pro-fonts adobe-source-serif-pro-fonts \<br>ttf-bitstream-vera ttf-inconsolata ttf-ubuntu-font-family \ <br>ttf-dejavu ttf-freefont ttf-linux-libertine ttf-liberation \<br>otf-ipafont ttf-amiri ttf-ancient-fonts ttf-ms-fonts \<br>ttf-monaco ttf-noto ttf-vista-fonts</pre><p>Fonts should be much better after that!</p><p>Finally, I like to use pulseaudio and pavucontrol, I guess using Fedora for a while open my heart to it :)</p><pre>yaourt -S --noconfirm pavucontrol pulseaudio pulseaudio-bluetooth<br>pulseaudio --start</pre><p>Wow! You should like your setup. I do, I love mine. Make sure you share your screenshot:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0NiQsTA07FUIOZpl.png" /></figure><p>Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1d7c4fe8bf3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recursion, Memoization and Dynamic Programming]]></title>
            <link>https://medium.com/@mimoralea/recursion-memoization-and-dynamic-programming-2083a1e1308e?source=rss-3d2d8215bd6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2083a1e1308e</guid>
            <category><![CDATA[dynamic-programming]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[fibonacci]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Miguel Morales]]></dc:creator>
            <pubDate>Sat, 28 Jan 2017 00:57:00 GMT</pubDate>
            <atom:updated>2017-01-28T00:57:00.643Z</atom:updated>
            <content:encoded><![CDATA[<p>I wanted to quickly show the differences between these 3 very related computer science concepts that tend to be mixed.</p><p>For that, I will work on a well know problem, the Fibonacci series.</p><p>The Fibonacci series looks something like: 0, 1, 1, 2, 3, 5, 8, 13, 21 … and so on. Any person with sufficient analytical skills would quickly notice the pattern.</p><p>f(n) = f(n-1) + f(n-2)</p><p>There are many ways someone can tackle this problem, the most intuitive one is recursion.</p><pre>def fib(n):<br>    if n &lt; 2:<br>        return n<br>    return fib(n-2) + fib(n-1)</pre><p>Timing this algorithm gives is about 257ms wall time.</p><p>%time fib(30)</p><blockquote>CPU times: user 266 ms, sys: 7.17 ms, total: 273 ms</blockquote><blockquote>Wall time: 257 ms</blockquote><blockquote>832040</blockquote><p>Now, the main problem of this algorithm is that we are computing some of the subproblems more than once. For instance, to compute fib(4) we would compute fib(3) and fib(2). However, to compute fib(3) we also have to compute fib(2). Say hello to memoization.</p><p>In memoization we are doing nothing but caching the results of previously computed sub problems.</p><pre>m = {}<br>def fibm(n):<br>    if n in m:<br>        return m[n]<br>    m[n] = n if n &lt; 2 else fibm(n-2) + fibm(n-1)<br>    return m[n]</pre><p>This algorithm is faster since we are avoiding extra computations, instead we are using a little more memory.</p><p>%time fibm(30)</p><blockquote>CPU times: user 38 µs, sys: 0 ns, total: 38 µs</blockquote><blockquote>Wall time: 27.2 µs</blockquote><blockquote>832040</blockquote><p>But the question is, can we do better than this? The use of the array is helpful, but when calculating very large numbers, or perhaps on memory contraint environments it might not be desirable. This is where Dynamic Programming fits the bill.</p><p>In DP we take a bottom-up approach. Meaning, we solve the next Fibonacci number we can with the information we already have.</p><pre>def fibdp(n):<br>    if n == 0: return 0<br>    prev, curr = (0, 1)<br>    for i in range(2, n+1):<br>        newf = prev + curr<br>        prev = curr<br>        curr = newf<br>    return curr</pre><p>In this format, we don’t need to recurse or keep up with the memory intensive cache dictionary. These, add up to an even better performance.</p><p>%time fibdp(30)</p><blockquote>CPU times: user 10 µs, sys: 0 ns, total: 10 µs</blockquote><blockquote>Wall time: 10 µs</blockquote><blockquote>832040</blockquote><p>Pretty cool, isn’t?</p><p>There is a lot of good information around the web to help you understand these methods better. I hope, however, that this post served you well.</p><p>Keep hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2083a1e1308e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Pianobar on Fedora 23]]></title>
            <link>https://medium.com/@mimoralea/installing-pianobar-on-fedora-23-c0aff02813fd?source=rss-3d2d8215bd6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0aff02813fd</guid>
            <category><![CDATA[fedora-linux]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[fedora]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Miguel Morales]]></dc:creator>
            <pubDate>Thu, 26 Jan 2017 23:12:01 GMT</pubDate>
            <atom:updated>2017-01-26T23:12:01.744Z</atom:updated>
            <content:encoded><![CDATA[<p>Pandora and pianobar are almost as important ‘tools’ on my development workflow as git and Emacs are. Not true, but sometimes I’m in the mood and capable of coding and listening to good music. Here is a quick tip on how to install pianobar on a Fedora system.</p><p>We start by cloning the repository:</p><pre>git clone git@github.com:PromyLOPh/pianobar.git</pre><p>Let’s install all the make dependencies at once, thank me later:</p><pre>sudo dnf groupinstall -y &quot;Development Tools&quot; &quot;Development Libraries&quot;<br>sudo dnf install -y <a href="http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm">http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm</a> <a href="http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm">http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm</a><br>sudo dnf install -y libcurl libcurl-devel make automake gcc gcc-c++ kernel-devel ffmpeg ffmpeg-devel libgcrypt libgcrypt-devel libao libao-devel json-c json-c-devel</pre><p>Next, build pianobar and install:</p><pre>cd pianobar<br>gmake clean<br>gmake<br>sudo gmake install</pre><p>Now, lets configure it:</p><pre>mkdir ~/.config/pianobar<br>cp contrib/config-example ~/.config/pianobar/config</pre><p>Go edit that file and add your Pandora username, password and set the autostart_station to your favorite personal station. To make pianobar’s output show in color uncomment the 3 format string lines. That’s it!</p><p>Put your headsets on, type pianobar and keep coding away!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0aff02813fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started With NVIDIA GPU, Anaconda, TensorFlow and Keras on Arch Linux]]></title>
            <link>https://medium.com/@mimoralea/getting-started-with-nvidia-gpu-anaconda-tensorflow-and-keras-on-arch-linux-8f5f2868a455?source=rss-3d2d8215bd6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f5f2868a455</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[arch-linux]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Miguel Morales]]></dc:creator>
            <pubDate>Tue, 24 Jan 2017 23:57:02 GMT</pubDate>
            <atom:updated>2017-01-24T23:57:02.666Z</atom:updated>
            <content:encoded><![CDATA[<h3>Intro</h3><p>This is actually a pretty simple setup. First, we will install NVIDIA drivers and CUDA, then we will install Anaconda, TensorFlow binaries for GPUs, and Keras.</p><h3>Install NVIDIA drivers</h3><p>Let’s first install the drivers and cuda:</p><pre>yaourt -S nvidia nvidia-utils cuda</pre><p>Now, you need to go to NVIDIA’s website and download the <a href="https://developer.nvidia.com/cudnn">cuDNN tarball</a>. Just place the file on your “Downloads” folder.</p><p>Next, we install the package with:</p><pre>yaourt -S cudnn</pre><p>This should install all NVIDIA dependencies. Let’s go now and install Anaconda.</p><pre>yaourt -S anaconda<br><em># add a pointer to anaconda&#39;s binaries to your path and load it on your open session</em><br>echo &quot;export PATH=&quot;/opt/anaconda/bin:$PATH&quot;&quot;  ~/.bash_profile<br>source ~/.bash_profile</pre><p>At this point you can check your installation with anaconda --version &amp;&amp; conda --version.</p><p>Let’s create an environment and install TensorFlow and Keras:</p><pre>conda create -n deep-learning<br>source activate deep-learning<br><em># at the time of writing this is the lastest binary for GPUs</em><br><em># go to </em><a href="https://www.tensorflow.org/get_started/os_setup"><em>https://www.tensorflow.org/get_started/os_setup</em></a><br><em># and grab the equivalent &quot;linux, gpu, python 3.5&quot;</em><br>export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.0-cp35-cp35m-linux_x86_64.whl<br>pip3 install --upgrade $TF_BINARY_URL<br>pip3 install ipython</pre><p>Now, you should be able to enter on an interactive Python session and load TensorFlow. Your output should look as below:</p><pre>(deep-learning) [mimoralea@hash ~]$ ipython<br>Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) <br>Type &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</pre><pre>IPython 5.1.0 -- An enhanced Interactive Python.<br>?         -&gt; Introduction and overview of IPython&#39;s features.<br>%quickref -&gt; Quick reference.<br>help      -&gt; Python&#39;s own help system.<br>object?   -&gt; Details about &#39;object&#39;, use &#39;object??&#39; for extra details.</pre><pre>In [1]: import tensorflow<br>I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally<br>I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally<br>I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally<br>I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally<br>I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally</pre><p>Great, now install Keras, configure it and test it.</p><pre>pip3 install keras<br>mkdir ~/.keras<br>vi ~/.keras/keras.json</pre><p>Add the keras config with these values:</p><pre>{<br>    &quot;image_dim_ordering&quot;: &quot;tf&quot;,<br>    &quot;epsilon&quot;: 1e-07,<br>    &quot;backend&quot;: &quot;tensorflow&quot;,<br>    &quot;floatx&quot;: &quot;float32&quot;<br>}</pre><p>Finally, test the end to end installation:</p><pre>(deep-learning) [mimoralea@hash ~]$ ipython<br>Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) <br>Type &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</pre><pre>IPython 5.1.0 -- An enhanced Interactive Python.<br>?         -&gt; Introduction and overview of IPython&#39;s features.<br>%quickref -&gt; Quick reference.<br>help      -&gt; Python&#39;s own help system.<br>object?   -&gt; Details about &#39;object&#39;, use &#39;object??&#39; for extra details.</pre><pre>In [1]: import keras<br>Using TensorFlow backend.<br>I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally<br>I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally<br>I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally<br>I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally<br>I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally</pre><p>Did you see “Using TensorFlow backend.”? That was Keras right there. Well done!</p><p>Let’s do a quick test:</p><p>First get out of your environement, update some packages and enable your environment again:</p><pre>source deactivate<br>conda update conda<br>conda update anaconda<br>conda install nomkl numpy scipy scikit-learn numexpr<br>conda update mkl<br>source activate deep-learning</pre><p>Now, let’s get that script running, you’ll like this, I promise.</p><pre><em># get into /tmp to garbage our work afterwards</em><br>cd /tmp<br>mkdir results<br><em># download the style transfer script</em><br>wget <a href="https://raw.githubusercontent.com/fchollet/keras/master/examples/neural_style_transfer.py">https://raw.githubusercontent.com/fchollet/keras/master/examples/neural_style_transfer.py</a><br><em># you need these packages to run this particular sample</em></pre><p>Now, download a couple of images that you like on the same folder. Call it myimage.jpg for example. I added this one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tu56unV_ldseP3-v.jpg" /></figure><p>Also, download a couple of the <a href="http://www.madisonartshop.com/20-most-famous-paintings-of-all-time.html">most famous paintings of all time</a>. Call it mystyle.jpg (or whatever you want, really). I actually got a pic of a painting my wife authored. Bonus point, you know… ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QeetSbjCtXvpeRzw.jpg" /></figure><p>Now, the magic command:</p><pre>python neural_style_transfer.py myimage.jpg mystyle.jpg results/myresult<br>ls -l results/</pre><p>There you should see all the intermediate images that resulted from it. 100th image looks ok, though I would probably leave it for a little longer to get a better result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/0*Ls2cS7dLP7l-P4Nu.png" /></figure><p>You can also create a gif:</p><pre>convert -delay 10 -loop 0 `ls -v *.png` animated.gif</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*puDVx4I4Yru4HP0FB-pXQg.gif" /></figure><p>For a point of comparison, you can see here the result <a href="http://www.deepart.io/">Deepart.io</a> return:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/0*VQ-nx5yLRU5JwINf.jpg" /></figure><p>I like theirs better, but ours is not that bad!! You just have to play with the settings for a little longer.</p><p>Here is a sample of how the same picture looks with another style:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*4qZP8CTXkJ5k98Ql.jpg" /></figure><p>Not bad, right? You can see the chunks of the oil painting transferred into this photo. This is pretty amazing.</p><p>Alright, enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f5f2868a455" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>