-
Motivation: Deep learning in vision, speech, text, robotics.
-
Deep learning courses:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import ( | |
| List, | |
| TypeVar, | |
| ) | |
| # Type aliases | |
| A = TypeVar('A') | |
| Digit = int | |
| Matrix = List[List[A]] | |
| Grid = Matrix[Digit] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| import Control.Applicative | |
| import Data.Char | |
| import Data.List (intersperse) | |
| import Data.Monoid hiding (All, Any) | |
| import Data.Foldable hiding (all, any) | |
| import Prelude hiding (all, any) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import singledispatch | |
| class Document: | |
| pass | |
| class Paragraph(Document): | |
| def __init__(self, text): | |
| self.text = text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import pdb | |
| import os | |
| import sys | |
| from collections import namedtuple | |
| import numpy as np | |
| import pandas as pd |
Definition (monoid). A monoid consists of:
- a set
M - a binary operation
· : M × M → M - an element
e ∈ M
such that
- the binary operation is associative, that is,
x · (y · z) = (x · y) · z, ∀ x, y, z ∈ M - the element
eis identity:x · e = x = e · x, ∀ x ∈ M.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE DeriveFunctor #-} | |
| {-# LANGUAGE InstanceSigs #-} | |
| {-# LANGUAGE LambdaCase #-} | |
| -- This script is based on Chris Taylor's gist: https://gist.github.com/chris-taylor/4745921 | |
| -- | |
| -- The main differences are: | |
| -- 1. An interpretation in a different monad, the RWS monad. This idea was also was taken from somewhere else: | |
| -- http://www.cs.uu.nl/docs/vakken/afp/assignment3.html | |
| -- 2. An implementation based on free monads, see the `IOActionFreeMonad.hs` file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import pdb | |
| from matplotlib import pyplot as plt | |
| from scipy.stats import multivariate_normal | |
| def gauss2d(mu, sigma, to_plot=False): | |
| w, h = 100, 100 | |
| std = [np.sqrt(sigma[0, 0]), np.sqrt(sigma[1, 1])] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """This code is inspired by the homework 2 from CSC421/2516 Winter 2019, | |
| but I'm taking a more functional approach. | |
| http://www.cs.toronto.edu/~rgrosse/courses/csc421_2019/homeworks/hw2.pdf | |
| http://www.cs.toronto.edu/~rgrosse/courses/csc421_2019/homeworks/maml.py | |
| """ | |
| import autograd.numpy as np | |
| import autograd as ag |