Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/BilalReffas/EmojiIntelligence
Neural Network built in Apple Playground using Swift
https://github.com/BilalReffas/EmojiIntelligence
ai apple artificial-intelligence ipad machine-learning macos network neural playground swift
Last synced: 25 days ago
JSON representation
Neural Network built in Apple Playground using Swift
- Host: GitHub
- URL: https://github.com/BilalReffas/EmojiIntelligence
- Owner: BilalReffas
- License: mit
- Created: 2017-04-10T03:44:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-21T19:41:25.000Z (over 6 years ago)
- Last Synced: 2024-10-30T00:33:18.293Z (about 2 months ago)
- Topics: ai, apple, artificial-intelligence, ipad, machine-learning, macos, network, neural, playground, swift
- Language: Swift
- Size: 410 KB
- Stars: 1,369
- Watchers: 35
- Forks: 83
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Swift-Playgrounds - Emoji Intelligence - Neural Network built in Apple Playground using Swift. π (Theoretical Computer Science / Machine Learning)
README
# EmojiIntelligence
Do you want to teach your machine emojis? π
I created a neural network entirely in Swift. This is a demo to demonstrate what is possible to solve.
I used the Playground on macOS.
I believe in open source I think to push humanity forward you have to open source all the things \o/
![](http://imgur.com/0urwCTN.png)
![](http://i.imgur.com/qhweGhT.gif)
You can watch the YouTube Video [here](https://www.youtube.com/watch?v=T9pplv7cZ7k)
## Abstract Overview
### This is how the encoded image look's like.
![](http://imgur.com/3iRGrFv.png)
### Neural Network Story
I used this challenge to learn more about neural networks and machine learning.
A neural network consists of layers, and each layer has neurons. My network has three layers: an input layer, a hidden layer, and an output layer.
The input to my network has 64 binary numbers. These inputs are connected to the neurons in the hidden layer. The hidden layer performs some computation and passes the result to the output layer neuron out. This also performs a computation and then outputs a 0 or a 1. The input layer doesnβt actually do anything, they are just placeholders for the input value. Only the neurons in the hidden layer and the output layer perform computations. The neurons from the input layer are connected to the neurons in the hidden layer. Likewise, both neurons from the hidden layer are connected to the output layer. These kinds of layers are called fully-connected because every neuron is connected to every neuron in the next layer. Each connection between two neurons has a weight, which is just a number. These weights form the brain of my network. For the activation function in my network, I use the sigmoid function. ![](http://i.imgur.com/Xrhx1wl.png)
Sigmoid is a mathematical function. The sigmoid takes in some number x and converts it into a value between 0 and 1. That is ideal for my purposes, since I am dealing with binary numbers.
This will turn a linear equation into something that is non-linear. This is important because without this, the network wouldnβt be able to learn any interesting things.I have already mentioned that the input to this network are 64 binary numbers. I resize the drawn image to 8x8 pixels which makes together 64 pixels. I go through the image and check each pixel if the pixel has a pink color I add a 1 to my array else I add a 0. At the end I will have 64 binary numbers which I can add to my input layer.
My main goal was to make neural network and machine learning more accessible and fun. As well to learn more about the powerful features of playgrounds and neural networks.
### Author
[@reffas_bilal](https://twitter.com/Reffas_Bilal)
[[email protected]]()
### Credits
[Vincent Esche](https://twitter.com/regexident)
[Per Harald Borgen](https://twitter.com/perborgen)
[Matthijs Hollemans](https://twitter.com/mhollemans)### Thank you π
If you like this project please leave a star π here on Github and share it.
### LuubraI'm working with [@leoMehlig ](https://twitter.com/leoMehlig) on Luubra. You will find more about it [here](https://www.luubra.com)
All pieces are handcrafted with a lot of love β€οΈ and sent all around the world π.
Β
### Known issues
This projecty is currently only working on macOS. There is a bug on the iPad I already submitted the issue on the Bug Reporter.
I hope Apple will fix this soon.### License
```
MIT LicenseCopyright (c) 2017 Luubra
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```