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
def shrink_loss(pseudo_label, logits_u_s, conf_thresh): | |
removed_class_idx = [] | |
loss_u_shrink_batch = 0 | |
B, C = pseudo_label.shape | |
max_probs = pseudo_label.max(dim=-1)[0] | |
mask = pseudo_label.ge(conf_thresh).float() | |
sorted_prob_w, sorted_idx = pseudo_label.topk(C, dim=-1, sorted=True) |
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
ps -AF | grep ssh | |
pkill -t pts/9 |
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
// ==UserScript== | |
// @name New Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match <$URL$> | |
// @icon <$ICON$> | |
// @grant none | |
// ==/UserScript== |
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
.open yfcc100m_dataset.sql | |
.databases | |
.tables | |
.schema yfcc100m_dataset | |
SELECT * from yfcc100m_dataset WHERE photoid=2932067831 LIMIT 1; | |
.mode csv | |
.headers on | |
.out yfcc100m_dump.csv | |
SELECT photoid, title, description, downloadurl FROM yfcc100m_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
def var_covar_loss(Z, alpha=1.0, beta=0.01): | |
eps = 1e-5 | |
K = z.shape[1] | |
# covariance matrix | |
C = torch.cov(Z.t()) | |
# Push sqrt of diagonal terms to 1 (std dev = 1.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
#!/bin/bash | |
# TODO might be more missing packages | |
# TODO Shard train set | |
# Install dependencies | |
cd /tmp | |
wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh | |
bash Anaconda3-2020.02-Linux-x86_64.sh -b -p $HOME/anaconda3 |
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 torch.autograd import Function | |
class GradientReversal(Function): | |
@staticmethod | |
def forward(ctx, x): | |
ctx.save_for_backward(x) | |
output = x | |
return output |
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
# Pascal Titan X, Titan Xp, 1080Ti, 1080, 1070Ti, 1070 ... = 6.1 | |
# Volta Titan V = 7.0 | |
# Turing Titan RTX, 2080Ti ... = 7.5 | |
export TORCH_CUDA_ARCH_LIST="6.1;7.0;7.5" # Pascal, Volta and Turing on CRCV Cluster | |
git clone https://github.com/NVIDIA/apex | |
cd apex | |
pip install --upgrade --force-reinstall -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ |
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
City | State | Constituency | |
---|---|---|---|
Mumbai | Maharashtra | Bhiwandi | |
Mumbai | Maharashtra | Kalyan | |
Mumbai | Maharashtra | Thane | |
Mumbai | Maharashtra | Mumbai North | |
Mumbai | Maharashtra | Mumbai North West | |
Mumbai | Maharashtra | Mumbai North East | |
Mumbai | Maharashtra | Mumbai North Central | |
Mumbai | Maharashtra | Mumbai South Central | |
Mumbai | Maharashtra | Mumbai South |
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 tensorflow as tf | |
import keras.backend as K | |
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.25) | |
sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options)) | |
K.set_session(sess) | |
## Use normally after this |
NewerOlder