#### What Will I Learn? - You will learn how to create a feed forward neural network in Clojure - You will learn how to build a hill climb algorithm - You will learn how to use Clojure Quil to sketch drawings #### Requirements - A firm knowledge of Lisp or Clojure - A decent knowledge of Linear Algebra and Machine Learning concepts - The Clojure Leiningen build tool and Java JDK 8+ #### Difficulty - Advanced #### Description In this **Clojure tutorial**, we use the **Quil library** to build out a picture/sketch generating **Feed Forward**, **Hill Climbing Neural Network**. There are various ways to approach this type of problem in Clojure. Clojure has such a small but powerful core set of language features that we can leverage to build our **Feed Forward Neural Network** with very few lines of code. First, we build out a bunch of **generic mathematical functions**. We need functions to help us preform **Linear Algebra** on the **Clojure Vector data type**. This includes functions that allow us to preform **Multiplication**, **Subtraction** and the **Dot Product**. We also create a few functions that allow us to **generate random Matrices and Vectors** based on the inputs. We then implement basic versions of the **Sigmoid function** and the **Tangent Hyperbolic function** which we will use as our Transfer Functions. These functions allow us to **normalize the inputs and outputs** based on the weighs that we get from our network. Next, we build out a library that allows us to actually construct our **Feed Forward Neural Network**. We use **Clojure Records** to build a network of layers which we can then **recursively iterate** through and preform operations on. We add some basic **genetic algorithms** in the form of our **Hill Climb Algorithm**. we use an arbitrary value to incrementally search for numbers that work as solutions to our problem. We have expected outputs which we are trying to train our network to work towards. We finally use the network inputs and outputs along with the **Quil library** to actually draw out random pictures. The inputs work as points that exist between our **X and Y coordinates** of the window and our outputs are used to assign values to the colors that fill the created shapes. The more **Neurons, Layers and Outputs** assigned to the **Neural Network**, the more complex and interesting the sketch will be. More complex **Networks** will also tax the computer's resources as a result of a lack of GPU optimization in this particular implementation. The source code for this project can be found [here](https://github.com/tensor-programming/Clojure_Nerual_Art) #### Video Tutorial <iframe width="560" height="315" src="https://www.youtube.com/embed/u7qg-anw2io" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> <br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@tensor/clojure-machine-learning-generating-art-feed-forward-hill-climb">Utopian.io - Rewarding Open Source Contributors</a></em><hr/>
author | tensor | ||||||
---|---|---|---|---|---|---|---|
permlink | clojure-machine-learning-generating-art-feed-forward-hill-climb | ||||||
category | utopian-io | ||||||
json_metadata | {"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":747512,"name":"clojure","full_name":"clojure/clojure","html_url":"https://github.com/clojure/clojure","fork":false,"owner":{"login":"clojure"}},"pullRequests":[],"platform":"github","type":"video-tutorials","tags":["utopian-io","steemstem","steemiteducation","programming","science"],"links":["https://github.com/tensor-programming/Clojure_Nerual_Art","https://www.youtube.com/embed/u7qg-anw2io","https://utopian.io/utopian-io/@tensor/clojure-machine-learning-generating-art-feed-forward-hill-climb"],"image":["https://img.youtube.com/vi/u7qg-anw2io/0.jpg"],"moderator":{"account":"amosbastian","time":"2018-02-23T10:09:42.781Z","flagged":true,"reviewed":false,"pending":false},"questions":[],"score":0} | ||||||
created | 2018-02-23 02:53:45 | ||||||
last_update | 2018-02-23 10:09:42 | ||||||
depth | 0 | ||||||
children | 3 | ||||||
last_payout | 2018-03-02 02:53:45 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 4.719 HBD | ||||||
curator_payout_value | 1.639 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 3,048 | ||||||
author_reputation | 87,856,203,149,624 | ||||||
root_title | "Clojure Machine Learning - Generating Art (Feed Forward, Hill Climb)" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 39,753,463 | ||||||
net_rshares | 1,421,162,775,736 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
pharesim | 0 | 77,509,250,248 | 0.02% | ||
lafona-miner | 0 | 128,427,496,655 | 2.5% | ||
kushed | 0 | 2,205,536,377 | 0.75% | ||
steem-id | 0 | 9,216,932,300 | 0.75% | ||
mrs.agsexplorer | 0 | 11,463,453,102 | 2% | ||
pheonike | 0 | 77,254,720 | 0.5% | ||
justtryme90 | 0 | 57,022,472,053 | 2% | ||
anwenbaumeister | 0 | 12,919,439,924 | 0.75% | ||
grandpere | 0 | 8,678,009,119 | 5% | ||
spiry-btc | 0 | 412,295,126 | 50% | ||
ausbitbank | 0 | 82,291,152,364 | 1% | ||
edrivegom | 0 | 109,812,686 | 0.05% | ||
liberosist | 0 | 49,947,591,783 | 0.75% | ||
timsaid | 0 | 5,131,088,912 | 1% | ||
stephen.king989 | 0 | 1,052,113,060 | 0.1% | ||
velourex | 0 | 1,141,658,837 | 0.75% | ||
freyman | 0 | 8,391,189,626 | 65% | ||
lemouth | 0 | 4,639,306,440 | 1% | ||
rjbauer85 | 0 | 157,961,697 | 5% | ||
anarchyhasnogods | 0 | 8,043,004,644 | 2.5% | ||
lamouthe | 0 | 1,117,789,902 | 5% | ||
jhermanbeans | 0 | 286,767,553 | 0.05% | ||
steemedia | 0 | 106,659,501 | 0.75% | ||
meerkat | 0 | 26,906,933,704 | 0.75% | ||
curie | 0 | 43,981,356,509 | 0.75% | ||
cebymaster | 0 | 132,892,418 | 0.75% | ||
hendrikdegrote | 0 | 516,027,101,501 | 0.75% | ||
steemstem | 0 | 119,781,714,391 | 5% | ||
oleg326756 | 0 | 252,282,294 | 0.27% | ||
cotidiana | 0 | 118,743,874 | 0.75% | ||
teofilex11 | 0 | 621,484,986 | 0.75% | ||
steemprentice | 0 | 1,196,260,939 | 0.05% | ||
foundation | 0 | 436,952,071 | 5% | ||
the-devil | 0 | 787,437,308 | 5% | ||
timothyb | 0 | 1,294,439,378 | 2% | ||
dna-replication | 0 | 1,255,383,278 | 5% | ||
pomperipossa | 0 | 319,453,564 | 0.05% | ||
lenin-mccarthy | 0 | 61,005,467 | 0.37% | ||
pacokam8 | 0 | 79,902,992 | 0.15% | ||
numpypython | 0 | 177,908,641 | 0.05% | ||
jamhuery | 0 | 955,693,957 | 5% | ||
dickturpin | 0 | 178,397,832 | 0.75% | ||
decibel | 0 | 140,185,371 | 0.25% | ||
nexusprime | 0 | 482,053,935 | 100% | ||
gindor | 0 | 65,537,391 | 0.1% | ||
scrooger | 0 | 85,424,924 | 0.36% | ||
mobbs | 0 | 8,458,559,302 | 4.25% | ||
bp423 | 0 | 147,907,821 | 0.75% | ||
shellyduncan | 0 | 245,029,274 | 0.1% | ||
kryzsec | 0 | 2,019,247,817 | 5% | ||
markangeltrueman | 0 | 178,322,623 | 0.37% | ||
fredrikaa | 0 | 9,553,049,343 | 2.5% | ||
qwasert | 0 | 117,309,285 | 0.1% | ||
cryptohustler | 0 | 185,857,881 | 0.5% | ||
tantawi | 0 | 82,749,350 | 0.75% | ||
minnowsupport | 0 | 19,283,093,162 | 0.5% | ||
jean.racines | 0 | 52,866,417 | 0.05% | ||
locikll | 0 | 420,333,138 | 1.5% | ||
dber | 0 | 2,450,454,365 | 5% | ||
crimsonclad | 0 | 2,361,171,495 | 3% | ||
aboutyourbiz | 0 | 210,269,709 | 0.75% | ||
dreamien | 0 | 149,948,004 | 0.75% | ||
myday | 0 | 167,002,745 | 0.05% | ||
gamerveda | 0 | 542,109,397 | 0.25% | ||
kerriknox | 0 | 19,625,387,844 | 5% | ||
alexander.alexis | 0 | 271,638,067 | 1% | ||
howtostartablog | 0 | 380,846,055 | 0.03% | ||
blessing97 | 0 | 168,591,040 | 5% | ||
tensor | 0 | 11,225,178,585 | 100% | ||
slickhustler007 | 0 | 50,338,873 | 0.37% | ||
mystifact | 0 | 865,167,273 | 5% | ||
coloringiship | 0 | 134,802,750 | 0.03% | ||
juanjdiaz89 | 0 | 197,621,187 | 5% | ||
nitesh9 | 0 | 1,246,138,222 | 5% | ||
discordiant | 0 | 1,438,214,524 | 3% | ||
himal | 0 | 331,563,233 | 5% | ||
abigail-dantes | 0 | 84,318,147,582 | 5% | ||
leczy | 0 | 492,626,949 | 5% | ||
ovij | 0 | 93,820,593 | 0.75% | ||
somethingburger | 0 | 269,090,974 | 5% | ||
theleapingkoala | 0 | 87,718,183 | 0.27% | ||
shawkr13 | 0 | 153,008,881 | 0.88% | ||
redpillproj | 0 | 124,394,959 | 0.75% | ||
cryptonator | 0 | 209,176,010 | 0.75% | ||
superdavey | 0 | 104,384,785 | 0.02% | ||
gotgame | 0 | 88,303,941 | 0.75% | ||
qurator | 0 | 41,536,024,681 | 1.1% | ||
bogaev | 0 | 554,970,246 | 100% | ||
carloserp-2000 | 0 | 787,108,738 | 5% | ||
rachelsmantra | 0 | 193,103,174 | 5% | ||
gra | 0 | 1,875,349,393 | 5% | ||
kedi | 0 | 841,558,471 | 2.5% | ||
steemtaker | 0 | 236,164,960 | 0.75% | ||
spectrums | 0 | 114,445,529 | 0.75% | ||
jasimg | 0 | 913,634,272 | 0.75% | ||
xanderslee | 0 | 79,221,130 | 0.75% | ||
kenadis | 0 | 1,350,911,124 | 5% | ||
amavi | 0 | 752,373,465 | 1% | ||
robotics101 | 0 | 119,778,774 | 4.25% | ||
gentleshaid | 0 | 1,654,379,579 | 5% | ||
luoq | 0 | 10,190,885,333 | 100% | ||
hadji | 0 | 212,502,115 | 5% | ||
steemstem-bot | 0 | 2,218,570,583 | 15% | ||
sinbad989 | 0 | 844,252,123 | 100% | ||
tomarazajcevak | 0 | 544,658,514 | 100% | ||
energyaddict22 | 0 | 61,216,961 | 0.27% | ||
nwjordan | 0 | 128,552,482 | 0.82% | ||
tdogvoid | 0 | 468,428,173 | 100% | ||
vaitelavicius | 0 | 52,556,084 | 10% | ||
hrissm | 0 | 285,850,743 | 0.75% | ||
sbi2 | 0 | 835,967,453 | 1% | ||
corker | 0 | 122,086,644 | 100% |
Your contribution cannot be approved because it does not follow the [Utopian Rules](https://utopian.io/rules), and is considered as **plagiarism**. Plagiarism is not allowed on Utopian, and posts that engage in plagiarism will be flagged and hidden forever. Plagiarised from [here](https://github.com/pearman/neural-network-art). You can contact us on [Discord](https://discord.gg/uTyJkNm). **[[utopian-moderator]](https://utopian.io/moderators)**
author | amosbastian |
---|---|
permlink | re-tensor-clojure-machine-learning-generating-art-feed-forward-hill-climb-20180223t101128611z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"} |
created | 2018-02-23 10:11:30 |
last_update | 2018-02-23 10:11:30 |
depth | 1 |
children | 0 |
last_payout | 2018-03-02 10:11:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 449 |
author_reputation | 174,473,586,900,705 |
root_title | "Clojure Machine Learning - Generating Art (Feed Forward, Hill Climb)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 39,832,821 |
net_rshares | 0 |
<p>Congratulations! This post has been upvoted from the communal account, @minnowsupport, by Tensor from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the <a href="https://discord.gg/HYj4yvw"> Peace, Abundance, and Liberty Network (PALnet) Discord Channel</a>. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.</p> <p>If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=102530.639667%20VESTS">50SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=205303.639667%20VESTS">100SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=514303.639667%20VESTS">250SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=1025303.639667%20VESTS">500SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=2053030.639667%20VESTS">1000SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=10253030.639667%20VESTS">5000SP</a>. <br><strong>Be sure to leave at least 50SP undelegated on your account.</strong></p>
author | minnowsupport |
---|---|
permlink | re-clojure-machine-learning-generating-art-feed-forward-hill-climb-20180223t050357 |
category | utopian-io |
json_metadata | "" |
created | 2018-02-23 05:03:57 |
last_update | 2018-02-23 05:03:57 |
depth | 1 |
children | 0 |
last_payout | 2018-03-02 05:03:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,702 |
author_reputation | 148,902,805,319,183 |
root_title | "Clojure Machine Learning - Generating Art (Feed Forward, Hill Climb)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 39,776,096 |
net_rshares | 0 |
<center><a href="www.steemit.com/@steemstem"><img src="https://media.discordapp.net/attachments/384404201544876032/405507994583957505/steemSTEM.png"></a><br><table><tr><th> </th><th> </th><th><a href="https://steemit.com/steemstem/@steemstem/helpful-guidelines-for-crafting-steemstem-content">Guidelines</a></th><th><a href="https://steemit.com/steemstem/@steemstem/steemstem-winter-2017-2018-project-update">Project Update</a></th><th> </th><th> </th></tr></table><br><a href="https://steemit.com/steemstem/@steemstem/being-a-member-of-the-steemstem-community"><b>Being A SteemStem Member</b></a></center>
author | steemstem-bot |
---|---|
permlink | re-clojure-machine-learning-generating-art-feed-forward-hill-climb-20180223t053702 |
category | utopian-io |
json_metadata | "" |
created | 2018-02-23 05:37:03 |
last_update | 2018-02-23 05:37:03 |
depth | 1 |
children | 0 |
last_payout | 2018-03-02 05:37:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.714 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 606 |
author_reputation | 3,811,533,615,496 |
root_title | "Clojure Machine Learning - Generating Art (Feed Forward, Hill Climb)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 39,781,975 |
net_rshares | 128,300,562,121 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
justtryme90 | 0 | 128,300,562,121 | 5% |