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 | |
# encoding: utf-8 | |
import tweepy #https://github.com/tweepy/tweepy | |
import csv | |
#Twitter API credentials | |
consumer_key = "" | |
consumer_secret = "" | |
access_key = "" |
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
''' | |
Neural artistic styler | |
Based on: Leon A. Gatys, Alexander S. Ecker, Matthias Bethge, "A Neural Algorithm of Artistic Style", arXiv:1508.06576 | |
Examples: https://www.bonaccorso.eu | |
See also: https://github.com/fchollet/keras/blob/master/examples/neural_style_transfer.py | |
Giuseppe Bonaccorso (https://www.bonaccorso.eu) | |
''' | |
from __future__ import print_function |
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
from sklearn.cluster import KMeans | |
from sklearn.datasets import make_blobs | |
from sklearn.metrics.pairwise import pairwise_distances | |
import multiprocessing | |
# Set random seed for reproducibility | |
np.random.seed(1000) | |
# Generate a dummy dataset |
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 | |
from Queue import Queue | |
class HMM: | |
def __init__(self, transition_matrix, observation_matrix, delay, initial_state): | |
self.TM = transition_matrix | |
self.OM = observation_matrix | |
self.delay = delay |
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
from sklearn.datasets import make_blobs | |
from sklearn.neighbors import NearestNeighbors | |
import matplotlib.pyplot as plt | |
import multiprocessing | |
import numpy as np | |
import time | |
# Set random seed (for reproducibility) | |
np.random.seed(1000) |
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 matplotlib.pyplot as plt | |
import numpy as np | |
# Set random seed for reproducibility | |
np.random.seed(1000) | |
nb_patterns = 4 | |
pattern_width = 4 | |
pattern_height = 4 | |
max_iterations = 100 |
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 matplotlib.pyplot as plt | |
import numpy as np | |
from sklearn.datasets import make_regression | |
# Set random seed (for reproducibility) | |
np.random.seed(1000) | |
nb_samples = 500 | |
nb_features = 4 |
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 cupy as cp | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from sklearn.datasets import fetch_olivetti_faces | |
# Set random seed for reproducibility | |
np.random.seed(1000) | |
cp.random.seed(1000) |
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 | |
from sklearn.datasets import make_classification | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.model_selection import train_test_split | |
# Set random seed (for reproducibility) | |
np.random.seed(1000) | |
nb_samples = 5000 |
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
from sklearn.datasets import load_digits | |
import numpy as np | |
# Set random seed for reproducibility | |
np.random.seed(1000) | |
# Load MNIST dataset | |
X, Y = load_digits(return_X_y=True) | |
X /= 255.0 |
OlderNewer