{
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.5.2"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0,
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "7c708946-7ff5-37b0-4412-0b85d22f0313",
        "_active": false,
        "collapsed": false
      },
      "outputs": [],
      "source": "%matplotlib inline\nimport math,sys,os,numpy as np\nfrom numpy.random import random\nfrom matplotlib import pyplot as plt, rcParams, animation, rc\nfrom __future__ import print_function, division\nfrom ipywidgets import interact, interactive, fixed\nfrom ipywidgets.widgets import *\nimport keras\nfrom keras import backend as K\nfrom keras.utils.data_utils import get_file\nfrom keras.models import Sequential\nfrom keras.layers import Input\nfrom keras.layers.core import Flatten, Dense, Dropout, Lambda\nfrom keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D\nfrom keras.optimizers import SGD, RMSprop\nfrom keras.preprocessing import image\n\nrc('animation', html='html5')\nrcParams['figure.figsize'] = 3, 3\n%precision 4\nnp.set_printoptions(precision=4, linewidth=100)",
      "execution_state": "idle"
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "af894201-cac9-140c-c810-2206405167e7",
        "_active": true
      },
      "outputs": [],
      "source": "x = random(3)\na = 9\nb = -20\ny = a * x + b\nprint(a * x)\nprint(y)\nplt.scatter(x, y)",
      "execution_state": "idle"
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "d71e8e12-4e18-80b7-3286-51c4d14fda00",
        "_active": false
      },
      "outputs": [],
      "source": "lm = Sequential([ Dense(1, input_shape=(3,1))])\nlm.compile(optimizer=SGD(lr=0.1), loss='mse')",
      "execution_state": "idle"
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "6c39b7df-3437-edb8-3529-a0eb616c806e",
        "_active": false
      },
      "outputs": [],
      "source": "lm.evaluate(x, y, verbose=0)",
      "execution_state": "idle"
    }
  ]
}