Test Driven
Neural
Networks
Matthew Kirk - Modulus 7
automatic playlists
The Challenge
“Big Data”
Languages

Java
Python
R
Julia
Clojure
Ruby has tools too
Ruby is not
Complex Math
Today we’ll cover
•
•
•
•

What feed forward neural networks are
How to classify strings to languages using Neural
Nets
Ho...
Neural
Networks!
aka the sledge hammer of
functional relationships
Neural Networks
Input layer
Hidden layer
How many Neurons?
• 2/3 * Input layer count + output count is a
good start

• Aggregation over expansion so less

neurons ...
Output layer
Neurons
Digital Logic
Fuzzy Logic
Activation Functions
• Sigmoid
• Elliott
• Gaussian
• Linear
• Threshold
• Cosine and Sine
Activation Functions
• Sigmoid => Learning Curve
• Elliott => Learning Curve
• Gaussian => Bell curve
• Linear => Line
• T...
Training Algorithms
• Quickprop
• RProp => Use this
• Back propagation
Visually What they do
Just the tip of the
Neural Nets
iceberg
Specifically
• English
• German
• Polish
• Swedish
• Finnish
• Norwegian
Data Collection
• Using the most translated book in the

world “The Bible” to collect sentences
used in each of these lang...
Now What?
Character Distribution
TDD Neural Nets
Test the Seams
describe Language do
it 'has the proper keys for each vector'
it 'sums to 1 for all vectors'
it 'returns ch...
Cross Validation
describe Network do
%w[English Finnish German Norwegian Polish Swedish].each do |lang|
it "Trains and cro...
Ockham’s Razor
Demo
modulus7.com/rubyconf
@mjkirk
Conclusion
This is just the beginning
Go learn more become more adept at data
analysis
Photo Credits
http://rickmanelius.com/article/do-you-dread-emails
http://www.flickr.com/photos/irisheyes/8469160004/
http:...
Rubyconf Neural Networks
Rubyconf Neural Networks
Rubyconf Neural Networks
Rubyconf Neural Networks
Rubyconf Neural Networks
Upcoming SlideShare
Loading in …5
×

Rubyconf Neural Networks

1,505 views

Published on

Neural networks are an excellent way of mapping past observations to a functional model. Many researchers have been able to build tools to recognize handwriting, or even jaundice detection.

While Neural Networks are powerful they still are somewhat of a mystery to many. This talk aims to explain neural networks in a test driven way. We'll write tests first and go through how to build a neural network to determine what language a sentence is.

By the end of this talk you'll know how to build neural networks with tests!

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,505
On SlideShare
0
From Embeds
0
Number of Embeds
849
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Rubyconf Neural Networks

  1. 1. Test Driven Neural Networks Matthew Kirk - Modulus 7
  2. 2. automatic playlists
  3. 3. The Challenge
  4. 4. “Big Data” Languages Java Python R Julia Clojure
  5. 5. Ruby has tools too
  6. 6. Ruby is not Complex Math
  7. 7. Today we’ll cover • • • • What feed forward neural networks are How to classify strings to languages using Neural Nets How to do it in a TDD fashion Demonstration
  8. 8. Neural Networks! aka the sledge hammer of functional relationships
  9. 9. Neural Networks
  10. 10. Input layer
  11. 11. Hidden layer
  12. 12. How many Neurons? • 2/3 * Input layer count + output count is a good start • Aggregation over expansion so less neurons in the hidden layer than on the input layer.
  13. 13. Output layer
  14. 14. Neurons
  15. 15. Digital Logic
  16. 16. Fuzzy Logic
  17. 17. Activation Functions • Sigmoid • Elliott • Gaussian • Linear • Threshold • Cosine and Sine
  18. 18. Activation Functions • Sigmoid => Learning Curve • Elliott => Learning Curve • Gaussian => Bell curve • Linear => Line • Threshold => Yes or No • Cosine and Sine => Periodic
  19. 19. Training Algorithms • Quickprop • RProp => Use this • Back propagation
  20. 20. Visually What they do
  21. 21. Just the tip of the Neural Nets iceberg
  22. 22. Specifically • English • German • Polish • Swedish • Finnish • Norwegian
  23. 23. Data Collection • Using the most translated book in the world “The Bible” to collect sentences used in each of these languages.
  24. 24. Now What?
  25. 25. Character Distribution
  26. 26. TDD Neural Nets
  27. 27. Test the Seams describe Language do it 'has the proper keys for each vector' it 'sums to 1 for all vectors' it 'returns characters that is a unique set of characters used' end
  28. 28. Cross Validation describe Network do %w[English Finnish German Norwegian Polish Swedish].each do |lang| it "Trains and cross-validates with an error of 5% for #{lang}" end end
  29. 29. Ockham’s Razor
  30. 30. Demo
  31. 31. modulus7.com/rubyconf @mjkirk
  32. 32. Conclusion This is just the beginning Go learn more become more adept at data analysis
  33. 33. Photo Credits http://rickmanelius.com/article/do-you-dread-emails http://www.flickr.com/photos/irisheyes/8469160004/ http://www.flickr.com/photos/andy_bernay-roman/2206610268/ http://www.flickr.com/photos/kev_walsh/2216144544/sizes/o/in/photostream/ http://www.flickr.com/photos/clover_1/2926385130/ http://www.flickr.com/photos/andy_bernay-roman/2206610268/sizes/o/in/photostream/ http://translate.google.com http://www.flickr.com/photos/epistemographer/68200471 http://www.allaboutcircuits.com/vol_4/chpt_3/5.html http://www.flickr.com/photos/brunobord/3987593006/

×