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 typing import List | |
from optuna.samplers import GridSampler | |
from optuna.study import Study | |
from optuna.trial import TrialState | |
class CustomGridSampler(GridSampler): | |
def _get_unvisited_grid_ids(self, study: Study) -> List[int]: | |
# List up unvisited grids based on already finished ones. |
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
losses = [] | |
loss_function = nn.NLLLoss() | |
model = LeModel(len(vocab)) | |
optimizer = optim.SGD(model.parameters(), lr=0.001) | |
for epoch in tqdm(range(1), leave=False): | |
total_loss = 0 | |
for context, target in tqdm(data, leave=False): | |
model.zero_grad() | |
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 torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
class CBOW(nn.Module): | |
def __init__(self, vocab_size: int, embedding_dim: int = 100, context_size: int = 4): | |
super(CBOW, self).__init__() | |
self.embeddings = nn.Embedding(vocab_size, embedding_dim) | |
self.linear1 = nn.Linear(context_size * embedding_dim, 128) |
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
# based on [sberryman/Dockerfile.yml](https://gist.github.com/sberryman/82a6d13a44f9c4a3bfaf9263b36c92ed) | |
# You need the cuda drivers and [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) | |
# | |
# build with | |
# docker build . | |
# | |
# run with | |
# docker run --runtime=nvidia -it --rm -v $(realpath ./data):/root/AlphaPose/data [imagename] ./run.sh --indir=/root/AlphaPose/data/in/ --outdir=data/out | |
FROM nvidia/cuda:8.0-cudnn5-devel |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Usage: ruby last_game.rb <summoner_name> <na/euw/...> | |
require "net/http" | |
require "json" | |
require "date" | |
# TODO: Insert your own key here! | |
API_KEY = "<YOUR-RIOT-API-KEY-HERE>" | |
@summoner_name = ARGV[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
lftp -u <ftp_user>,<ftp_password> <ftp_host> -e "rm -rf `date --date="3 days ago" '+%Y-%m-%d_'`*; exit" | |
# make sure to escape % for cron: | |
lftp -u <ftp_user>,<ftp_password> <ftp_host> -e "rm -rf `date --date="3 days ago" '+\%Y-\%m-\%d_'`*; exit" |
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
# shell command: | |
pg_dump <db_name> -U <db_user> -h <db_host> | gzip | curl -u <ftp_user>:<ftp_password> ftp://<ftp_host>/`date '+%Y-%m-%d_%H-%M'`/db_backup.sql.gz --ftp-create-dirs -T - | |
# if you want to execute it through cron, be sure to escape all %! | |
# for crontab: | |
pg_dump <db_name> -U <db_user> -h <db_host> | gzip | curl -u <ftp_user>:<ftp_password> ftp://<ftp_host>/`date '+\%Y-\%m-\%d_\%H-\%M'`/db_backup.sql.gz --ftp-create-dirs -T - |
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
### Keybase proof | |
I hereby claim: | |
* I am cschell on github. | |
* I am cschell (https://keybase.io/cschell) on keybase. | |
* I have a public key whose fingerprint is D5A4 78EF 6166 5BAC A6D5 E6AC 4BED 524B 758B D750 | |
To claim this, I am signing this object: |