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 multiprocessing | |
import numpy as np | |
import tensorflow as tf | |
from keras.datasets import cifar10 | |
# Set random seed (for reproducibility) | |
np.random.seed(1000) | |
tf.set_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 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 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 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 |
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 | |
# Set random seed for reproducibility | |
np.random.seed(1000) | |
nb_patterns = 4 | |
pattern_width = 4 | |
pattern_height = 4 | |
max_iterations = 10 |
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_classification | |
import numpy as np | |
# Set random seed (for reproducibility) | |
np.random.seed(1000) | |
def sigmoid(arg): | |
return 1.0 / (1.0 + np.exp(-arg)) |
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 scipy.sparse import dok_matrix | |
from sklearn.metrics.pairwise import pairwise_distances | |
import numpy as np | |
# Set random seed (for reproducibility) | |
np.random.seed(1000) | |
# Create a dummy user-item dataset | |
nb_users = 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 | |
import tensorflow as tf | |
from sklearn.datasets import make_blobs | |
# Set random seed (for reproducibility) | |
np.random.seed(1000) | |
# Create dataset | |
nb_samples=2000 |
NewerOlder