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
class Solution: | |
def __init__(self) -> None: | |
# count: 3 | |
grid1 = [ | |
[0, 0, 1, 1, 0], | |
[0, 1, 1, 1, 1], | |
[0, 0, 0, 0, 0], | |
[1, 1, 1, 1, 1], | |
[0, 0, 0, 0, 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 time | |
import ray | |
@ray.remote(num_cpus=2) | |
class C(object): | |
def __init__(self) -> None: | |
self.stop = 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
if [ -z "$EXP_DIR" ] | |
then | |
EXP_DIR=/home/docker/ | |
fi | |
echo "EXP_DIR: $EXP_DIR" | |
cd $EXP_DIR | |
# mkdir 3rdparty | |
# cd 3rdparty |
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 | |
echo "task: ${1}, to be killed" | |
ps -ef | grep $1 | |
echo "killing task: ${1}" | |
for id in `ps -ef | grep $1 | awk ' { print $2 } '`; do kill -9 $id; done |
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
secondString="pdf"; | |
sec=""; | |
while IFS="," read title url; do | |
nurl=${url/forum/$secondString}; | |
ntitle=${title//[:?^]/_}; | |
wget -O ./papers/21-"${ntitle}".pdf $(echo $nurl | tr -d '\r';) & | |
done < iclr_papers.csv |
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 | |
echo "[INFO] Starting running tensorboard from logpath $1" | |
tensorboard --logdir $1 --host 0.0.0.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/sh | |
# | |
# print total CPU usage in percent of all available users | |
# but skips the ones with a CPU usage of zero | |
# | |
# 1st column: user | |
# 2nd column: aggregated CPU usage | |
# 3rd column: normalized CPU usage according to the number of cores | |
# | |
# to sort by CPU usage, pipe the output to 'sort -k2 -nr' |
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 torch as th | |
import torch.nn as nn | |
import matplotlib.pyplot as plt | |
from torch.optim import Adam | |
arr = np.arange(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 argparse | |
import multiprocessing | |
import tqdm | |
import openreview | |
import pandas as pd | |
def worker(reviews): | |
client = openreview.Client(baseurl='https://api.openreview.net', username='', password='') |