• IT Specialist
  • Who I am
  • Blog

Kopfknacker

~ breaking my head...

Tag Archives: artificial intelligence

Neural Network – really easy explained – I mean: really!

26 Samstag Mrz 2016

Posted by Christoph Diefenthal in Artificial Intelligence, Technologie

≈ Leave a Comment

Tags

AI, artificial intelligence, deeplearning, machinelearning, neural network, software

There is a lot talking going on about neural networks, deep learning, artifical intelligence. When people talk about neural networks I sometimes get the impression, that they think it’s

  1. either some almost lifelike thing : „it’s like the brain!“
  2. or that it’s really complicated math stuff, which no „normal“ person can understand.

Well first things first: it’s nothing lifelike at all.

It is actually just math: just adding and multiplying numbers. And it really looks complicated. But if you bite through all this math formulas, some books and some online video tutorials you get the impression, that the basics are not some kind of „higher math“ – it’s just complicated because you have a lot of numbers to calculate with.

 

If you have a bunch of numbers on a page, you can get really confused, what to multiply and add with what and where. To learn this stuff and to understand it sustainably(!) I needed some simple examples with which I can repeat this stuff again and again. And I learn best, if I explain it to someone else – therefore I wanted to create a presentation about neural networks.

A couple of month ago I stumbled over Trask’s article in which he wrote a neural network in just 11 lines of code.1 That really helped me a lot in doing my slides. I reused his code to calculate the numbers you find in this article. I plan to publish my IPython notebook corresponding to this article as well. It’s just not ready yet :-)

So, have fun!

 

And yeah it reeeeally looks complicated in math :-)

Andrew Ng explains Neural Network Backpropagation in the coursera machine learning MOOC

Andrew Ng explains neural network backpropagation in the coursera machine learning MOOC

But do not get me wrong: Andrew Ng is a really good and really pleasant teacher and I really like his course. I still look at it form time to time, if something is unclear to me (again :-). If you had a view at my slides and still want to know more about neural networks, I highly recommend his course. The math formulas do really have their rights here, because there is no better language to encapsulate the whole calculation process in just some tiny symbols. Understanding the formulas makes it much easier to talk about changes in the calculations in different implementations of neural networks. And in the course there is more stuff about neural networks. For example how to avoid errors like the one on my last screens.

  1. In case you wonder, how you can calculate so many numbers in just 11 lines of code: That’s another story about matrix multiplication, which is just like a „writing simplification“ of doing all the equations manually – if you need to refresh your school knowledge about matrix multiplication, I highly recommend the Khan-Academy. [↩]

Analysing DATA2 – Star Trek and Predict Who Said What via Multinomial Naive Bayes

24 Sonntag Jan 2016

Posted by Christoph Diefenthal in Artificial Intelligence, Data Analytics, Technologie

≈ Leave a Comment

Tags

AI, artificial intelligence, machinelearning, multinomial naive bayes, naive bayes, nlp, picard, star trek, stng, tfidf

In Part 1 of analysing the „Star Trek: The Next Generation“ transcripts, I performed some statistical analysis of the characters and episodes: who has the most lines and appears in which episodes, etc.

In my new Ipython notebook I concentrated on the text itself. This was actually my first motivation to work with the Star Trek: The Next Generation transcripts from chakoteya.net: I wanted to try out some machine learning algorithms. I came up with the idea to predict which STNG character is the speaker of a text-line or just any word.

Predicting Who Said What

I would say the results are pretty convincing if you look at some phrases:

  • „My calculations are correct“ is ascribed to Data with 78% probability.  
  • Who would not have thought, that it is Troi uttered a sentence like „Captain, I’m sensing a powerful mind.“ with 73% probability
  • And who would use the word „Mom“? Obviously Wesley with 88% probability.
  • Where instead „Mother“ is a word used by Deanna Troi with 60% probability.
  • But „Deanna!“ is used by Riker, not that exclusively (just 48% probability)
  • And he is called „Number One“ by no other than Picard with almost 100% probability

Some more examples:

some_predictions

Also, the characters most used words are very descriptive for the characters, as we know them:

most_used_words

But have a look for yourself.

How to get there

To do all this, there where some steps included, which have been a real good practice in python, numpy, pandas and sklearn.

  1. I had to download and clean the data, which was a good practice in startrekng-episodes-analysis_01.ipynb.
  2. I did some statistical analysis of dataset with python, numpy and pandas in startrekng-episodes-analysis_02.ipynb.
  3. Finally we arrived in startrekng-episodes-analysis_03.ipynb, where I concentrate on predicting the speakers with the use of 2 algorithms: the „Term Frequency – Inverse Document Frequency“  and „Multinomial Naive Bayes“ („sklearn.feature_extraction.text.TfidfVectorizer“ and „sklearn.naive_bayes.MultinomialNB“)

Practical Background

To do all this, I learned a lot from the „pandas“-book and from the scikit-learn-examples like the MLComp-text-classification. And obviously almost nothing could have been done without stackoverflow.

Theoretical Background

If anyone is interested in the foundation of the algorithms, I recommend the coursera MOOC „Probabilistic Graphical Models“ by Stanford Professor Daphne Koller and the „Natural Language Processing“ course by Dan Jurafsky and Christopher Manning. Also the udacity course about Machine Learning is pretty helpful.

Eine Einführung in Reinforcement Learning – Ein kleines Beispiel für künstliche Intelligenz

15 Donnerstag Jan 2015

Posted by Christoph Diefenthal in Artificial Intelligence, Technologie

≈ 1 Comment

Tags

AI, artificial intelligence, howto, java, ki, künstliche intelligenz, machinelearning, tutorial

Vor einem halben Jahr habe ich das erste Mal die KI-Technologie Reinforcement Learning erwähnt – auf Deutsch: Bestärkendes Lernen.

Mittlerweile habe ich mich ein wenig tiefer eingearbeitet und ein kleines Beispiel programmiert, um auch ein besseres Gefühl für die Technologie zu gewinnen. Anhand dieses Mini-Progamms möchte ich Reinforcement Learning vorstellen.

Worum gehts?

Bei RL geht es im einfachsten Fall um einen Agenten, der die beste Strategie (Policy) ermittelt, um in einer Umgebung (Environment) ein Ziel (Goal-State) zu erreichen. Dabei kann er durch festgelegte Aktionen (Action) von einem Zustand (State) in den anderen wechseln, bis er letztlich den Goal-State erreicht.

Klingt noch ein wenig abstrakt. Nehmen wir ein einfaches Beispiel:
Wir haben eine Schachbrett ähnliche Fläche, in der sich ganz unten rechts (Feld „10,10“) der Agent befindet. Der Agent kann immer einen Schritt nach oben, unten, rechts oder links gehen. Er soll die beste Kombination von Schritten zum leuchtenden Ziel-Zustand (+) finden und dabei vermeiden in die schwarzen Löcher (-) zu fallen.

grid_agens

1- The Grid and a smiling agent

Wie kann Software das bewerkstelligen?

 

 

Continue reading »

Categories

  • Artificial Intelligence
  • Data Analytics
  • Innovation
  • Leadership
  • Learning
  • Motivation
  • Organisation
  • Philosophical
  • Technologie
  • Uncategorized
  • User Interface

Tags

3D 3D Drucker AI anfänger artificial intelligence aufmerksamkeit begreifen biblionetz blog deeplearning delegieren denkfehler dueck early adopters erfindung erwartungen führung gedanken gelassenheit hüther innovation intelligenz ki konstruktivismus konzepte lernen machinelearning motivation multitouch organisieren programmieren real schreiben sinek software softwareentwicklung statistik thebrain triz vertrauen virtuell wahrheit wissen worte zukunft

Last Posts

  • Auf zu neuen Welten
  • Neural Network – really easy explained – I mean: really!
  • Analysing DATA2 – Star Trek and Predict Who Said What via Multinomial Naive Bayes
  • Analyzing DATA – Pandas, Python and Star Trek: The Next Generation
  • No one can tell you you can’t learn about yourself!

Archive

  • September 2018
  • März 2016
  • Januar 2016
  • Oktober 2015
  • August 2015
  • Juni 2015
  • Februar 2015
  • Januar 2015
  • Dezember 2014
  • November 2014
  • September 2014
  • August 2014
  • Juli 2014
  • Juni 2014
  • März 2014
  • Februar 2014
  • Januar 2014
  • November 2013
  • Oktober 2013
  • August 2013
  • Juli 2013
  • Juni 2013
  • Mai 2013

Meta

  • Anmelden
  • Feed der Einträge
  • Kommentare-Feed
  • WordPress.org

Tweets

Meine Tweets

Proudly powered by WordPress Theme: Chateau by Ignacio Ricci.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.

Notwendig immer aktiv

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Nicht notwendig

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.