Skip to content

Instantly share code, notes, and snippets.

View azmadoppler's full-sized avatar

Thanawit Gerdprasert azmadoppler

  • YU, Japan
View GitHub Profile
import torch.nn.functional as F
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import numpy as np
# ---- 1. Extract features from the SimCLR encoder ----
model.eval()
all_features = []
all_labels = []
# 17 list comprehension problems in python
fruits = ['mango', 'kiwi', 'strawberry', 'guava', 'pineapple', 'mandarin orange']
numbers = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 19, 23, 256, -8, -4, -2, 5, -9]
# Example for loop solution to add 1 to each number in the list
numbers_plus_one = []
for number in numbers:
numbers_plus_one.append(number + 1)