SlideShare a Scribd company logo
Tensorgo?
Using Wistfully looking at
Tensorflow in GO
ME
Background
Test, Test Automation,
Support, Development,
Release Engineering,
Management and now
back to development
with teamwork.com
No Data Science?
Nope. Just someone
who is interested in all
the amazing things
happening in this space
Tensorflow experience
About 7 days… yeah honestly you’ll soon see
Deep Neural Network - In diagram form
Definition
Input Layer - Source of data. No transforms just pass it on
Bias Nodes - Always on. Always set to 1. Think of it as b in y = ax + b. Shifts a
function by allowing flexibility.
Hidden Layer - > 1 layer here makes it a deep network. This is where
calculations are applied and result past to next layer. Hidden because values
not in training set. S
Output Layer - Result from the model. During training this is compared to
expected and used to change weights to improve model
https://ujjwalkarn.me/2016/08/09/quick-intro-neural-networks/
Some good intro resources
https://stevenmiller888.github.io/mind-how-to-build-a-neural-network/
https://www.quora.com/ELI5-What-are-neural-networks is a nice example and talks about how you would get a computer to learn
a ‘square’ function
https://stats.stackexchange.com/questions/63152/what-does-the-hidden-layer-in-a-neural-network-compute
Talks about hidden layers and classifying pictures of a bus. You might look for wheels. For a box. Checking the size etc and if all
3 hit you’re confident this is a bus…
http://ufldl.stanford.edu/tutorial/supervised/MultiLayerNeuralNetworks/
https://stackoverflow.com/questions/38248657/why-does-simple-2-layer-neural-network-cannot-learn-0-0-sequence#38253140
https://stackoverflow.com/questions/1697243/perceptron-learning-algorithm-not-converging-to-0
OK but what’s tensorflow
Collection of API’s to allow you to create, train and
consume the models we are talking about.
Machine learning toolkit in other words
https://www.tensorflow.org/get_started/ - official docs
Colab notebooks are COOL but a bit slow
Other good introductions
https://eu.udacity.com/course/deep-learning--ud730 - Free course from Google
https://developers.google.com/machine-learning/crash-course/ml-intro -
amazing google course
https://developers.google.com/machine-learning/glossary/ -Glossary
https://medium.com/all-of-us-are-belong-to-machines/the-gentlest-introduction-
to-tensorflow-248dc871a224
https://dzone.com/refcardz/introduction-to-tensorflow?chapter=1 - focused on
worked examples in python
https://www.youtube.com/watch?v=MotG3XI2qSs
https://www.youtube.com/watch?v=5DknTFbcGVM
TensorFlow & Go
Just GO?
Java and C supported as well it seems.
Swift and JS just announced and the original C++ and
Python so it may soon become ubiquitous
Getting setup
https://www.tensorflow.org/install/install_go
Hello Gopher Version
Let’s review the hello world version
https://gist.github.com/PatrickWalker/78e7cbaf3bcb791150
5990409a33dfa6
^ added some comments
We can create a graph, setup a session to execute the
graph and scoop out the results. Nice.
It’s exactly the same as the python version...
What’s different?
Tensortflow was initially for C++ and Python. Go is a relative newcomer with it and it’s not
fully featured yet
It is not officially designated to support creation and training of models. Yep that’s right. You
shouldn’t train a model with go…
Ok so it’s not ideal but don’t leave yet.
You can in theory train your model in Go, but the API isn’t stable, but the suggested
‘idiomatic’ way is to train it in python and consume it in go so not all is lost
The idiotmatic way
THE PATRICK WAY
Let some other brainboxes do that bit. It’s the hardest bit.
We’ll just profit on other peoples work.
We will re-use work from other people. GENIUS. If only
there was a common shared place that gave you
confidence...
Tensorflow Hub
https://www.tensorflow.org/hub/
Recently launched.
TensorFlow Hub is a library to foster the publication, discovery, and
consumption of reusable parts of machine learning models. A module is a
self-contained piece of a TensorFlow graph, along with its weights and assets,
that can be reused across different tasks in a process known as transfer
learning.
Other new stuff?
● Tensorflow lite (mobile)
● Tensorflow JS
● Probability API
● Community Focus
More here
https://medium.com/tensorflow/highlights-from-tensorflow-
developer-summit-2018-cd86615714b2
https://www.youtube.com/tensorflow
Twitter Sentiment
Why?
Interested in doing a competitor analysis for a project we are about to
undertake for work.
What I would love to do is get a stream of tweets using a search term. Push
them through a SPECIAL MACHINE (our tensorflow model in this case) and
know if they are positive or negative statements.
Then try and work out common words/themes that show up in both category to
know what is loved and what isn’t loved
Isn’t this overkill
Well there is an api essentially to do it but that probably wouldn’t have been
too interesting for a tensorflow meetup :D
There are ready made github libraries but I struggled to
get actual results from them. Everything was deemed
neutral or positive even if I searched for overwhelmingly
negative things like “Internet Explorer” or “James
Corden” or “middle aged men crowbarring gifs into tech
presentations”
So I started to think about making my
own naive bayes classification system...
How?
Went to lift a fully featured trained twitter sentiment model from the hub…
Doesn’t exist because these are building blocks. It’s more of a library. So there
are text helpers and one even looks at semantic similarity between sentences
but would take a fair amount of building and actual brain power to make the full
thing. That’s not me.
So off to github and scouring blogs I went.
How?
Followed this blog and made an amazing model which would allow us to check
sentiment of strings. AMAZING. Thought porting to go would be easy.
<voiceover> it was not easy </voiceover>
Training the model in Python was pretty straightforward but time consuming
and resource hungry.
Had to change the exported model format after the 2nd go as it had seperated
weights and model which made parsing them again hard.
This left with me with a trained model (github) and now it was time to interact
with it in Go
Go Code
Followed this blog and made an amazing model which would allow us to check
sentiment of strings. AMAZING. Thought porting to go would be easy.
<voiceover> it was not easy </voiceover>
Training the model in Python was pretty straightforward but time consuming
and resource hungry.
Had to change the exported model format after the 2nd go as it had separated
weights and model which made parsing them again hard.
This left with me with a trained model and now it was time to interact with it in
Go...
Go Code
That’s when you realise that unless you define some sort of contract on the
model it can be quite hard to parse and understand the format of the input
tensor etc to get the model going again in another context (go in this case).
Imagine trying to talk to an undocumented api in a language that had no json
helper...
Also don’t have* wonderous helpers like numpy and others to help make the
tensors so it’s a bit hokey in Go atm.
I mean I forked python code which allowed me to do this out of the box so I’m
unsure why you would want to redo half of it in another language.
Summary
● Really interesting area
● If you’re familiar with Go or organizationally invested in
Go you can still get involved in Tensorflow
● It probably isn’t the right thing to do imo. Python is.
● Javascript seems like the priority now for other
languages so not sure when Go will get the love
As of today Go isn’t really the language of ML
The End?
The End

More Related Content

Similar to Tensorflow go

Data Science Salon: Deep Learning as a Product @ Scribd
Data Science Salon: Deep Learning as a Product @ ScribdData Science Salon: Deep Learning as a Product @ Scribd
Data Science Salon: Deep Learning as a Product @ Scribd
Formulatedby
 
Prototype4Production Presented at FOSSASIA2015 at Singapore
Prototype4Production Presented at FOSSASIA2015 at SingaporePrototype4Production Presented at FOSSASIA2015 at Singapore
Prototype4Production Presented at FOSSASIA2015 at Singapore
Dhruv Gohil
 
Intro to Drupal Slides - DrupalCampSC 2014
Intro to Drupal Slides - DrupalCampSC 2014Intro to Drupal Slides - DrupalCampSC 2014
Intro to Drupal Slides - DrupalCampSC 2014
Sarah Shealy
 
Upwork time log and difficulty 20160523
Upwork time log and difficulty 20160523Upwork time log and difficulty 20160523
Upwork time log and difficulty 20160523
Sharon Liu
 
What does OOP stand for?
What does OOP stand for?What does OOP stand for?
What does OOP stand for?
Colin Riley
 
Learning through answering
Learning through answeringLearning through answering
Learning through answering
Eran Zimbler
 
Simplifying training deep and serving learning models with big data in python...
Simplifying training deep and serving learning models with big data in python...Simplifying training deep and serving learning models with big data in python...
Simplifying training deep and serving learning models with big data in python...
Holden Karau
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
Derek Jacoby
 
Build chatbots with api.ai and Google cloud functions
Build chatbots with api.ai and Google cloud functionsBuild chatbots with api.ai and Google cloud functions
Build chatbots with api.ai and Google cloud functions
The Incredible Automation Day
 
A class action
A class actionA class action
A class action
Luciano Colosio
 
TOP PYTHON INTERVIEW QUESTIONS AND ANSWERS 2021
TOP PYTHON INTERVIEW QUESTIONS AND ANSWERS 2021TOP PYTHON INTERVIEW QUESTIONS AND ANSWERS 2021
TOP PYTHON INTERVIEW QUESTIONS AND ANSWERS 2021
Sprintzeal
 
You shouldneverdo
You shouldneverdoYou shouldneverdo
You shouldneverdodaniil3
 
SaltStack For DevOps, Free Sample
SaltStack For DevOps, Free SampleSaltStack For DevOps, Free Sample
SaltStack For DevOps, Free Sample
Aymen EL Amri
 
Js basics
Js basicsJs basics
Js basics
TranTom1
 
Pair Programming - Be the best pair you can be.
Pair Programming - Be the best pair you can be.Pair Programming - Be the best pair you can be.
Pair Programming - Be the best pair you can be.
David Morgantini
 
On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)
Zoe Landon
 
Intro to iteration power point slide.pptx
Intro to iteration power point slide.pptxIntro to iteration power point slide.pptx
Intro to iteration power point slide.pptx
yosieposie8
 
Future proofing design work with Web components
Future proofing design work with Web componentsFuture proofing design work with Web components
Future proofing design work with Web components
btopro
 
Monad Fact #6
Monad Fact #6Monad Fact #6
Monad Fact #6
Philip Schwarz
 
'10 Great but now Overlooked Tools' by Graham Thomas
'10 Great but now Overlooked Tools' by Graham Thomas'10 Great but now Overlooked Tools' by Graham Thomas
'10 Great but now Overlooked Tools' by Graham Thomas
TEST Huddle
 

Similar to Tensorflow go (20)

Data Science Salon: Deep Learning as a Product @ Scribd
Data Science Salon: Deep Learning as a Product @ ScribdData Science Salon: Deep Learning as a Product @ Scribd
Data Science Salon: Deep Learning as a Product @ Scribd
 
Prototype4Production Presented at FOSSASIA2015 at Singapore
Prototype4Production Presented at FOSSASIA2015 at SingaporePrototype4Production Presented at FOSSASIA2015 at Singapore
Prototype4Production Presented at FOSSASIA2015 at Singapore
 
Intro to Drupal Slides - DrupalCampSC 2014
Intro to Drupal Slides - DrupalCampSC 2014Intro to Drupal Slides - DrupalCampSC 2014
Intro to Drupal Slides - DrupalCampSC 2014
 
Upwork time log and difficulty 20160523
Upwork time log and difficulty 20160523Upwork time log and difficulty 20160523
Upwork time log and difficulty 20160523
 
What does OOP stand for?
What does OOP stand for?What does OOP stand for?
What does OOP stand for?
 
Learning through answering
Learning through answeringLearning through answering
Learning through answering
 
Simplifying training deep and serving learning models with big data in python...
Simplifying training deep and serving learning models with big data in python...Simplifying training deep and serving learning models with big data in python...
Simplifying training deep and serving learning models with big data in python...
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
 
Build chatbots with api.ai and Google cloud functions
Build chatbots with api.ai and Google cloud functionsBuild chatbots with api.ai and Google cloud functions
Build chatbots with api.ai and Google cloud functions
 
A class action
A class actionA class action
A class action
 
TOP PYTHON INTERVIEW QUESTIONS AND ANSWERS 2021
TOP PYTHON INTERVIEW QUESTIONS AND ANSWERS 2021TOP PYTHON INTERVIEW QUESTIONS AND ANSWERS 2021
TOP PYTHON INTERVIEW QUESTIONS AND ANSWERS 2021
 
You shouldneverdo
You shouldneverdoYou shouldneverdo
You shouldneverdo
 
SaltStack For DevOps, Free Sample
SaltStack For DevOps, Free SampleSaltStack For DevOps, Free Sample
SaltStack For DevOps, Free Sample
 
Js basics
Js basicsJs basics
Js basics
 
Pair Programming - Be the best pair you can be.
Pair Programming - Be the best pair you can be.Pair Programming - Be the best pair you can be.
Pair Programming - Be the best pair you can be.
 
On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)On Selecting JavaScript Frameworks (Women Who Code 10/15)
On Selecting JavaScript Frameworks (Women Who Code 10/15)
 
Intro to iteration power point slide.pptx
Intro to iteration power point slide.pptxIntro to iteration power point slide.pptx
Intro to iteration power point slide.pptx
 
Future proofing design work with Web components
Future proofing design work with Web componentsFuture proofing design work with Web components
Future proofing design work with Web components
 
Monad Fact #6
Monad Fact #6Monad Fact #6
Monad Fact #6
 
'10 Great but now Overlooked Tools' by Graham Thomas
'10 Great but now Overlooked Tools' by Graham Thomas'10 Great but now Overlooked Tools' by Graham Thomas
'10 Great but now Overlooked Tools' by Graham Thomas
 

Recently uploaded

ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 

Recently uploaded (20)

ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 

Tensorflow go

  • 1. Tensorgo? Using Wistfully looking at Tensorflow in GO
  • 2. ME Background Test, Test Automation, Support, Development, Release Engineering, Management and now back to development with teamwork.com No Data Science? Nope. Just someone who is interested in all the amazing things happening in this space Tensorflow experience About 7 days… yeah honestly you’ll soon see
  • 3. Deep Neural Network - In diagram form
  • 4. Definition Input Layer - Source of data. No transforms just pass it on Bias Nodes - Always on. Always set to 1. Think of it as b in y = ax + b. Shifts a function by allowing flexibility. Hidden Layer - > 1 layer here makes it a deep network. This is where calculations are applied and result past to next layer. Hidden because values not in training set. S Output Layer - Result from the model. During training this is compared to expected and used to change weights to improve model https://ujjwalkarn.me/2016/08/09/quick-intro-neural-networks/
  • 5. Some good intro resources https://stevenmiller888.github.io/mind-how-to-build-a-neural-network/ https://www.quora.com/ELI5-What-are-neural-networks is a nice example and talks about how you would get a computer to learn a ‘square’ function https://stats.stackexchange.com/questions/63152/what-does-the-hidden-layer-in-a-neural-network-compute Talks about hidden layers and classifying pictures of a bus. You might look for wheels. For a box. Checking the size etc and if all 3 hit you’re confident this is a bus… http://ufldl.stanford.edu/tutorial/supervised/MultiLayerNeuralNetworks/ https://stackoverflow.com/questions/38248657/why-does-simple-2-layer-neural-network-cannot-learn-0-0-sequence#38253140 https://stackoverflow.com/questions/1697243/perceptron-learning-algorithm-not-converging-to-0
  • 6. OK but what’s tensorflow Collection of API’s to allow you to create, train and consume the models we are talking about. Machine learning toolkit in other words https://www.tensorflow.org/get_started/ - official docs Colab notebooks are COOL but a bit slow
  • 7. Other good introductions https://eu.udacity.com/course/deep-learning--ud730 - Free course from Google https://developers.google.com/machine-learning/crash-course/ml-intro - amazing google course https://developers.google.com/machine-learning/glossary/ -Glossary https://medium.com/all-of-us-are-belong-to-machines/the-gentlest-introduction- to-tensorflow-248dc871a224 https://dzone.com/refcardz/introduction-to-tensorflow?chapter=1 - focused on worked examples in python https://www.youtube.com/watch?v=MotG3XI2qSs https://www.youtube.com/watch?v=5DknTFbcGVM
  • 9. Just GO? Java and C supported as well it seems. Swift and JS just announced and the original C++ and Python so it may soon become ubiquitous
  • 11. Hello Gopher Version Let’s review the hello world version https://gist.github.com/PatrickWalker/78e7cbaf3bcb791150 5990409a33dfa6 ^ added some comments We can create a graph, setup a session to execute the graph and scoop out the results. Nice. It’s exactly the same as the python version...
  • 12. What’s different? Tensortflow was initially for C++ and Python. Go is a relative newcomer with it and it’s not fully featured yet It is not officially designated to support creation and training of models. Yep that’s right. You shouldn’t train a model with go… Ok so it’s not ideal but don’t leave yet. You can in theory train your model in Go, but the API isn’t stable, but the suggested ‘idiomatic’ way is to train it in python and consume it in go so not all is lost
  • 13. The idiotmatic way THE PATRICK WAY Let some other brainboxes do that bit. It’s the hardest bit. We’ll just profit on other peoples work. We will re-use work from other people. GENIUS. If only there was a common shared place that gave you confidence...
  • 14. Tensorflow Hub https://www.tensorflow.org/hub/ Recently launched. TensorFlow Hub is a library to foster the publication, discovery, and consumption of reusable parts of machine learning models. A module is a self-contained piece of a TensorFlow graph, along with its weights and assets, that can be reused across different tasks in a process known as transfer learning.
  • 15. Other new stuff? ● Tensorflow lite (mobile) ● Tensorflow JS ● Probability API ● Community Focus More here https://medium.com/tensorflow/highlights-from-tensorflow- developer-summit-2018-cd86615714b2 https://www.youtube.com/tensorflow
  • 17. Why? Interested in doing a competitor analysis for a project we are about to undertake for work. What I would love to do is get a stream of tweets using a search term. Push them through a SPECIAL MACHINE (our tensorflow model in this case) and know if they are positive or negative statements. Then try and work out common words/themes that show up in both category to know what is loved and what isn’t loved
  • 18. Isn’t this overkill Well there is an api essentially to do it but that probably wouldn’t have been too interesting for a tensorflow meetup :D There are ready made github libraries but I struggled to get actual results from them. Everything was deemed neutral or positive even if I searched for overwhelmingly negative things like “Internet Explorer” or “James Corden” or “middle aged men crowbarring gifs into tech presentations” So I started to think about making my own naive bayes classification system...
  • 19. How? Went to lift a fully featured trained twitter sentiment model from the hub… Doesn’t exist because these are building blocks. It’s more of a library. So there are text helpers and one even looks at semantic similarity between sentences but would take a fair amount of building and actual brain power to make the full thing. That’s not me. So off to github and scouring blogs I went.
  • 20. How? Followed this blog and made an amazing model which would allow us to check sentiment of strings. AMAZING. Thought porting to go would be easy. <voiceover> it was not easy </voiceover> Training the model in Python was pretty straightforward but time consuming and resource hungry. Had to change the exported model format after the 2nd go as it had seperated weights and model which made parsing them again hard. This left with me with a trained model (github) and now it was time to interact with it in Go
  • 21. Go Code Followed this blog and made an amazing model which would allow us to check sentiment of strings. AMAZING. Thought porting to go would be easy. <voiceover> it was not easy </voiceover> Training the model in Python was pretty straightforward but time consuming and resource hungry. Had to change the exported model format after the 2nd go as it had separated weights and model which made parsing them again hard. This left with me with a trained model and now it was time to interact with it in Go...
  • 22. Go Code That’s when you realise that unless you define some sort of contract on the model it can be quite hard to parse and understand the format of the input tensor etc to get the model going again in another context (go in this case). Imagine trying to talk to an undocumented api in a language that had no json helper... Also don’t have* wonderous helpers like numpy and others to help make the tensors so it’s a bit hokey in Go atm. I mean I forked python code which allowed me to do this out of the box so I’m unsure why you would want to redo half of it in another language.
  • 23. Summary ● Really interesting area ● If you’re familiar with Go or organizationally invested in Go you can still get involved in Tensorflow ● It probably isn’t the right thing to do imo. Python is. ● Javascript seems like the priority now for other languages so not sure when Go will get the love As of today Go isn’t really the language of ML

Editor's Notes

  1. https://godoc.org/github.com/tensorflow/tensorflow/tensorflow/go#example-PartialRun This approach is actually used in the go doc and referenced in tensorflow getting started
  2. There’s been some attempts but you’ll find most of the tutorials on this roll their own tensors