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
#!/usr/bin/env python3 | |
import argparse | |
import re | |
import yaml | |
import json | |
from pathlib import Path | |
from comet_ml import ExistingExperiment | |
from src.marcos import * | |
from src.utils import run_cmd |
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
#!/usr/bin/env python3 | |
from pathlib import Path | |
import json | |
import time | |
import re | |
from numpy.lib.format import open_memmap | |
import numpy as np | |
import kaldiio | |
import pickle |
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
GAMMA =1.0/10 # (1/D) | |
### Model ### | |
def sir_diff_eq(y, t, r0, gamma, N, t_y_interpolated): | |
S, I, R = y | |
def beta(t): | |
try: | |
return t_y_interpolated[int(t)] * r0 * gamma | |
except: |
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
# for mathjax and katex usage | |
snippet $$ | |
<span>$${1}$</span>${0} | |
snippet \[ | |
<div> | |
\[ | |
${1} | |
\] | |
</div> |
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
snippet my_template | |
#pragma GCC optimize ("O2") | |
#include<bits/stdc++.h> | |
#include<unistd.h> | |
using namespace std; | |
#define ALL(x) begin(x),end(x) | |
#define IOS ios_base::sync_with_stdio(0); cin.tie(0) | |
//freopen(name".in", "r", stdin); | |
//freopen(name".out", "w", stdout); | |
template<typename A, typename B> |
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
{{ $ := .root }} | |
{{ $page := .page }} | |
<!-- Accomplishments widget --> | |
<div class="row"> | |
<div class="col-12 col-lg-4 section-heading"> | |
<h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1> | |
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }} | |
</div> | |
<div class="col-12 col-lg-8"> |
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 os | |
from pathlib import Path | |
from comet_ml import Experiment, ExistingExperiment | |
from src.marcos import * | |
import src.monitor.logger as logger | |
class Dashboard: | |
"""Record training/evaluation statistics to comet | |
:params config: dict |
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 numpy as np | |
from pathlib import Path | |
from torch.utils.data import Dataset, DataLoader, Sampler | |
from torch.nn.utils.rnn import pad_sequence | |
import src.monitor.logger as logger | |
import random | |
# from numpy.lib.format import open_memmap |
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 DataContainer: | |
def __init__(self, data_dirs, batch_size, dev_batch_size, is_memmap, | |
is_bucket, num_workers=0, min_ilen=None, max_ilen=None, | |
half_batch_ilen=None, bucket_reverse=False, shuffle=True, | |
read_file=False, drop_last=False, pin_memory=True): | |
self.data_dirs = data_dirs | |
self.num_datasets = len(self.data_dirs) | |
self.batch_size = batch_size | |
self.is_memmap = is_memmap |
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
#include<bits/stdc++.h> | |
using namespace std; | |
class Solution{ | |
public: | |
vector<int> findOrder(int numCourses, vector<pair<int, int>>& prerequisites) { | |
vector<int> seq; | |
// 0 -> not visited | |
// 1 -> visiting | |
// 2 -> already left |
NewerOlder