-
PyTorchStepByStep - Chapter 8: Sequences
摘要:Data Generation points, directions = generate_sequences(n=128, seed=13) And then let’s visualize the first ten squares: The corners show the order in
阅读全文
-
PyTorchStepByStep - Extra Chapter: Vanishing and Exploding Gradients
摘要:Data Generation x, y = load_data(n_points=1000, n_dims=10) Next, we can use these data points to create a dataset and a data loader (no mini-batches t
阅读全文
-
PyTorch - Difference between rand() and randn()
摘要:rand() - Returns a tensor filled with random numbers from a uniform distribution on the interval [0, 1) torch.rand(100) tensor([0.7880, 0.3032, 0.3627
阅读全文
-
PyTorchStepByStep - Chapter 7: Transfer Learning
摘要:http://wordnet.princeton.edu http://www.image-net.org/ https://tinyurl.com/3ppc3xy2 http://www.image-net.org/challenges/LSVRC/ https://papers.nips.cc/
阅读全文
-
PyTorchStepByStep - Chapter 6: Rock, Paper, Scissors…
摘要:https://storage.googleapis.com/download.tensorflow.org/data/rps.zip https://storage.googleapis.com/download.tensorflow.org/data/rps-test-set.zip temp_
阅读全文
-
Python - setattr
-
Matplotlib - TypeError: 'Axes' object is not subscriptable
摘要:Error code: fig, axs = plt.subplots(n_filters, n_in_channels, figsize=figsize) print(axs[0, 0]) This is because n_filters = 1 and n_in_channels = 1, a
阅读全文
-
PyTorchStepByStep - Chapter 5: Convolutions
摘要:single = np.array( [[[[5, 0, 8, 7, 8, 1], [1, 9, 5, 0, 7, 7], [6, 0, 2, 4, 6, 6], [9, 7, 6, 6, 8, 4], [8, 3, 8, 5, 1, 3], [7, 2, 7, 0, 1, 0]]]] ) sing
阅读全文
-
PyTorchStepByStep - Bonus Chapter: Feature Space
-
PyTorchStepByStep - Chapter 4: Classifying Images
摘要:images, labels = generate_dataset(img_size=5, n_images=300, binary=True, seed=13) And then let’s visualize the first 30 images: image_r = np.zeros((5,
阅读全文
-
Numpy - np.c_
-
VSCode - Error loading webview: Error: Could not register service workers: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..
摘要:Fixed with restarting VSCode.
阅读全文
-
PyTorchStepByStep - Chapter 3: A Simple Classification Problem
摘要:from sklearn.datasets import make_moons from sklearn.model_selection import train_test_split X, y = make_moons(n_samples=100, noise=.3, random_state=0
阅读全文
-
PyTorchStepByStep - Chapter 2.1: Going Classy
摘要:class StepByStep(): def __init__(self, model, loss_fn, optimizer): self.device = 'cuda' if torch.cuda.is_available() else 'cpu' self.model = model.to(
阅读全文
-
VSCode - TensorBoard Extention
-
PyTorchStepByStep - Chapter 2: Rethinking the Training Loop
摘要:def make_train_step_fn(model, loss_fn, optimizer): def perform_train_step_fn(x, y): # Set model to TRAIN mode model.train() # Step 1 - Compute model's
阅读全文
-
Jupyter - Magic Function Usage
摘要:%%writefile data_preparation/v0.py device = 'cuda' if torch.cuda.is_available() else 'cpu' # Our data was in Numpy arrays, but we need to transform th
阅读全文
-
PyTorchStepByStep - Chapter 1: A Simple Regression Problem
摘要:Regression is a statistical technique that relates a dependent variable to one or more independent variables. A regression model is able to show wheth
阅读全文
|