{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "align_type": "Left", "slide_type": "-" } }, "source": [ "### Machine Learning\n", "# 4. Artificial Neural Networks" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### [Luis Martí](http://lmarti.com)\n", "#### [Instituto de Computação](http://www.ic.uff)\n", "#### [Universidade Federal Fluminense](http://www.uff.br)\n", "$\\newcommand{\\vec}[1]{\\boldsymbol{#1}}$" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true, "slideshow": { "slide_type": "skip" } }, "outputs": [], "source": [ "import random, itertools\n", "import numpy as np\n", "import pandas as pd\n", "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import matplotlib.cm as cm\n", "from mpl_toolkits.mplot3d import Axes3D" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "plt.rc('text', usetex=True); plt.rc('font', family='serif')\n", "plt.rcParams['text.latex.preamble'] ='\\\\usepackage{libertine}\\n\\\\usepackage[utf8]{inputenc}'\n", "\n", "import seaborn\n", "seaborn.set(style='whitegrid'); seaborn.set_context('talk')\n", "\n", "%matplotlib inline\n", "%config InlineBackend.figure_format = 'retina'" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "random.seed(a=42)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true, "slideshow": { "slide_type": "skip" } }, "outputs": [], "source": [ "from ipywidgets import interact, interactive, fixed\n", "import ipywidgets as widgets" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true, "slideshow": { "slide_type": "skip" } }, "outputs": [], "source": [ "# tikzmagic extesion for figures - https://github.com/mkrphys/ipython-tikzmagic\n", "%load_ext tikzmagic\n", "# for rendering graphviz dot files - https://github.com/cjdrake/ipython-magic\n", "%load_ext gvmagic" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Why to study bio-inspired methods\n", "\n", "* Nature is one of the best problem-solvers we know.\n", "* Evolutionary optimization.\n", "* Natural intelligence and artificial intelligence\n", " * Cellular automata\n", " * **Neural computation**\n", " * Evolutionary computation\n", " * Swarm intelligence\n", " * Artificial immune systems\n", " * Membrane computing\n", " * Amorphous computing" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Pigeons as art connoisseurs (Watanabe et al., 1995)\n", "* Pigeons were put in a Skinner box, and\n", "* presented with photos of paintings by Monet and Picasso. \n", "* They were rewarded if they recognized correctly the painter they were presented with.\n", "\n", " | $x_1$ | \n", "$x_2$ | \n", "
---|---|---|
0 | \n", "0.480006 | \n", "0.435149 | \n", "
1 | \n", "0.878279 | \n", "0.398403 | \n", "
2 | \n", "0.199872 | \n", "0.388055 | \n", "
3 | \n", "0.970218 | \n", "0.947632 | \n", "
4 | \n", "0.173001 | \n", "0.550177 | \n", "
5 | \n", "0.152957 | \n", "0.419160 | \n", "
6 | \n", "0.321359 | \n", "0.810125 | \n", "
7 | \n", "0.874931 | \n", "0.660673 | \n", "
8 | \n", "0.927528 | \n", "0.986753 | \n", "
9 | \n", "0.917003 | \n", "0.421432 | \n", "
\n", " | $x_1$ | \n", "$x_2$ | \n", "y | \n", "
---|---|---|---|
0 | \n", "0.480006 | \n", "0.435149 | \n", "0 | \n", "
1 | \n", "0.878279 | \n", "0.398403 | \n", "1 | \n", "
2 | \n", "0.199872 | \n", "0.388055 | \n", "0 | \n", "
3 | \n", "0.970218 | \n", "0.947632 | \n", "1 | \n", "
4 | \n", "0.173001 | \n", "0.550177 | \n", "0 | \n", "
5 | \n", "0.152957 | \n", "0.419160 | \n", "0 | \n", "
6 | \n", "0.321359 | \n", "0.810125 | \n", "1 | \n", "
7 | \n", "0.874931 | \n", "0.660673 | \n", "1 | \n", "
8 | \n", "0.927528 | \n", "0.986753 | \n", "1 | \n", "
9 | \n", "0.917003 | \n", "0.421432 | \n", "1 | \n", "
Software | Version |
---|---|
Python | 3.6.1 64bit [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] |
IPython | 5.3.0 |
OS | Darwin 16.5.0 x86_64 i386 64bit |
scipy | 0.19.0 |
numpy | 1.12.1 |
matplotlib | 2.0.0 |
sklearn | 0.18.1 |
Sat Apr 08 16:46:11 2017 -03 |