This file contains 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 matplotlib.pyplot as plt | |
from matplotlib.patches import Ellipse | |
import matplotlib.transforms as transforms | |
def confidence_ellipse(x, y, ax, n_std=3.0, facecolor='none', **kwargs): | |
""" | |
Create a plot of the covariance confidence ellipse of `x` and `y` | |
See how and why this works: https://carstenschelp.github.io/2018/09/14/Plot_Confidence_Ellipse_001.html |
This file contains 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 torch | |
from torch import LongTensor | |
from torch.nn import Embedding, LSTM | |
from torch.autograd import Variable | |
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence | |
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium'] | |
# | |
# Step 1: Construct Vocabulary | |
# Step 2: Load indexed data (list of instances, where each instance is list of character indices) |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Example employing Lasagne for digit generation using the MNIST dataset and | |
Least Squares Generative Adversarial Networks | |
(LSGANs, see https://arxiv.org/abs/1611.04076 for the paper). | |
It is based on a WGAN example: | |
https://gist.github.com/f0k/f3190ebba6c53887d598d03119ca2066 |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Example employing Lasagne for digit generation using the MNIST dataset and | |
Wasserstein Generative Adversarial Networks | |
(WGANs, see https://arxiv.org/abs/1701.07875 for the paper and | |
https://github.com/martinarjovsky/WassersteinGAN for the "official" code). | |
It is based on a DCGAN example: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Example employing Lasagne for digit generation using the MNIST dataset and | |
Deep Convolutional Generative Adversarial Networks | |
(DCGANs, see http://arxiv.org/abs/1511.06434). | |
It is based on the MNIST example in Lasagne: | |
http://lasagne.readthedocs.org/en/latest/user/tutorial.html |
This file contains 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
""" | |
Functions to create network diagrams from a list of Layers. | |
Examples: | |
Draw a minimal diagram to a pdf file: | |
layers = lasagne.layers.get_all_layers(output_layer) | |
draw_to_file(layers, 'network.pdf', output_shape=False) | |
Draw a verbose diagram in an IPython notebook: |