Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e514713
Affine FwdandBack done
botforge Sep 20, 2019
d05672b
Almost done with backprop
botforge Sep 21, 2019
fa5bc2c
done with backprop
botforge Sep 21, 2019
f8b153a
foward prop definetly works
botforge Sep 21, 2019
c1b740d
this finally works double double
botforge Sep 21, 2019
e253108
everything fixed forward
botforge Sep 21, 2019
b47afab
still trying to figure out loss calculation
botforge Sep 21, 2019
f31780e
one level backprop works fine
botforge Sep 21, 2019
cfea641
MLP done
botforge Sep 21, 2019
9047da1
modular layers done
botforge Sep 22, 2019
c460006
going to try messing with loss one sec
botforge Sep 22, 2019
1985afd
just submit it
botforge Sep 22, 2019
728e9b5
almost finished with everything
botforge Sep 22, 2019
06099f0
All done time to submit
botforge Sep 23, 2019
73a0612
my scan is better than thrust?
botforge Sep 23, 2019
b1ab20b
Update README.md
botforge Sep 23, 2019
f906f8f
Update README.md
botforge Sep 23, 2019
c125853
more done
botforge Sep 23, 2019
d6b08da
Merge branch 'master' of https://github.com/botforge/Project2-Number-…
botforge Sep 23, 2019
a3d47db
Update README.md
botforge Sep 23, 2019
7563dbb
early exits added
botforge Sep 23, 2019
9ca5d3d
Update README.md
botforge Sep 23, 2019
e3123a4
Update README.md
botforge Sep 23, 2019
5ec8aa4
Update README.md
botforge Sep 23, 2019
4a01f54
Merge branch 'master' of https://github.com/botforge/Project2-Number-…
botforge Sep 23, 2019
9092dfa
added performance images
botforge Sep 23, 2019
14ad554
Update README.md
botforge Sep 23, 2019
6058841
Update README.md
botforge Sep 23, 2019
4761e59
Update README.md
botforge Sep 23, 2019
2dd7e71
Update README.md
botforge Sep 23, 2019
5a38a2f
Update README.md
botforge Sep 23, 2019
18a9ed0
Update README.md
botforge Sep 23, 2019
01c143b
Update README.md
botforge Sep 23, 2019
99b49c4
added charreg
botforge Sep 23, 2019
ea0650b
Update README.md
botforge Sep 23, 2019
2a5d0ca
Update README.md
botforge Sep 23, 2019
e4dda37
Update README.md
botforge Sep 23, 2019
b8d8222
Update README.md
botforge Sep 23, 2019
8a8b6a7
done readmes
botforge Sep 23, 2019
288342f
goodperceptron added
botforge Sep 23, 2019
be0c09f
Update README.md
botforge Sep 23, 2019
486aaa5
Update README.md
botforge Sep 23, 2019
d39ef9d
Update README.md
botforge Sep 23, 2019
308ca6c
Update README.md
botforge Sep 23, 2019
6e08b5f
Update README.md
botforge Sep 23, 2019
2917ddf
Update README.md
botforge Sep 23, 2019
3e935a8
added last graph
botforge Sep 23, 2019
7f27536
Merge branch 'master' of https://github.com/botforge/Project2-Number-…
botforge Sep 23, 2019
9d71c38
Update README.md
botforge Sep 23, 2019
6de1e95
Update README.md
botforge Sep 23, 2019
d2a288b
Update README.md
botforge Oct 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 36 additions & 7 deletions Project2-Character-Recognition/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
CUDA Character Recognition
======================

**University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 2**

* (TODO) YOUR NAME HERE
* (TODO) [LinkedIn](), [personal website](), [twitter](), etc.
* Tested on: (TODO) Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab)
Dhruv Karthik: [LinkedIn](https://www.linkedin.com/in/dhruv_karthik/)

Tested on: Windows 10 Home, Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz, 16GM, GTX 2070 - Compute Capability 7.5
____________________________________________________________________________________
![Developer](https://img.shields.io/badge/Developer-Dhruv-0f97ff.svg?style=flat) ![CUDA 10.1](https://img.shields.io/badge/CUDA-10.1-yellow.svg) ![Built](https://img.shields.io/appveyor/ci/gruntjs/grunt.svg) ![Issues](https://img.shields.io/badge/issues-none-green.svg)
____________________________________________________________________________________
## Outcome
### XOR Convergence
![](img/chareg.PNG)

## Analysis

**Background** : As illustrated in the image above, I could train an XOR MLP via backpropagation. You can visually see backpropagation work by setting the learning rate to 1 and watching the softmax probabilities shift wildly on each training iteration. I trained the network with Binary Cross Entropy Loss, the network strure is illustrated as part of the Addtional Implementation Features section below.

**Loss**: The losses would vary on each example due to random initialization, but my best loss on the XOR problem was **0.005005**

## Additional Implementation Features
### Variable MLP Builder & Batched Updates

Define any MLP very easily as follows:
```C++
//Network Structure
int numSamples = 1;
int inputDim = 2;
int numLayers = 1;
int hiddenDim[1] = {5};
int outputDim = 2;
```
Notice ```numSamples```. This allows you to set the batchSize of the Neural Network to perform Batched Gradient Descent, as opposed to stochastic gradient descent which is the base implementation. This required that I implement an ```AffineLayer``` class and construct matrices out of these, and handle backpropagation for variables batches.
### Variable Input Sizes and biases

This is a consequence of the previous feature, as I can accept arbitrarily sized inputs and outputs via the ```inputDim``` and ```outputDim``` variables. I also had the option of including biases.

### (TODO: Your README)
## Tragic Historical Significance of the XOR Problem
Neural Networks are not new. In 1958, [Frank Rosenblatt](https://en.wikipedia.org/wiki/Frank_Rosenblatt) proposed a hypothetical model of a brain's nervous system and coined it the *perceptron*. Essentially, this model fit a line to a dataset. However, as seen below, you can't fit a line to an XOR function.

Include analysis, etc. (Remember, this is public, so don't put
anything here that you don't want to share with the world.)
![](img/goodperceptron.png)

The perceptron got a ton of hype in the 60's, but two authors published a [book](https://mitpress.mit.edu/books/perceptrons) on emphasizing why perceptron's are terrible, because they can't fit the XOR function. This book single handedly resulted in the first of three AI Winters. If it weren't that book, the students of CIS 565 in 2010 would also be implementing MLP's in CUDA!
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ set(SOURCE_FILES

cuda_add_library(character_recognition
${SOURCE_FILES}
OPTIONS -arch=sm_20
OPTIONS -arch=sm_75
)
Loading