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 check_line_by_line(fn_result, fn_truth): | |
logger.info(f"Checking line by line in {fn_result} and {fn_truth}") | |
with open(fn_result, 'r') as results: | |
res = results.readlines() | |
with open(fn_truth, 'r') as truth: | |
tru = truth.readlines() | |
for i, (line_t, line_r) in enumerate(zip(tru, res)): | |
features = line_t.split('\x01') |
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 get_type_hints | |
def cast(argname, value, hints): | |
""" Only cast arguments if type hints are available for them. | |
""" | |
if argname in hints: | |
expected_type = hints[argname] | |
if not issubclass(type(value), expected_type): | |
# Will throw type error if argument cannot be cast |
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_trainer.trainer import Trainer | |
from torch_trainer.callbacks import rms_callback | |
from torch import nn | |
from torch.optim import Adam | |
import torch.nn.functional as F | |
import numpy as np | |
import pandas as pd | |
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
https://github.com/tensorboy/pytorch_Realtime_Multi-Person_Pose_Estimation | |
https://github.com/tensorboy/3d-pose-baseline | |
http://www.tvmlang.org/2017/10/06/nnvm-compiler-announcement.html |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> Login to See Leaderboard </title> | |
</head> | |
<body> | |
<script> | |
window.fbAsyncInit = function() { | |
FB.init({ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Facebook Login JavaScript Example</title> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<script> | |
// This is called with the results from from FB.getLoginStatus(). | |
function statusChangeCallback(response) { |
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
"dein Scripts----------------------------- | |
if &compatible | |
set nocompatible " Be iMproved | |
endif | |
" Required: | |
set runtimepath+=/Users/moody/.vim/bundles/repos/github.com/Shougo/dein.vim | |
" Required: | |
if dein#load_state('/Users/moody/.vim/bundles') |
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
embeddings_mu = nn.Embedding(n_words, n_dim) | |
embeddings_lv = nn.Embedding(n_words, n_dim) | |
... | |
vector_mu = embeddings_mu(c_index) | |
vector_lv = embeddings_lv(c_index) | |
def normal(mu, lv): | |
random = torch.FloatTensor(std.size()).normal_() | |
return mu + random * torch.exp(0.5 * lv) |
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 chainer | |
from chainer import cuda | |
from chainer import training | |
from chainer.training import extensions | |
from chainer.datasets import TupleDataset | |
from chainer.iterators import SerialIterator | |
class Wrapper(object): | |
def __init__(self, model, batchsize=512, n_epochs=100, device=None, |
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
'housing social issues, affordability, rent', | |
'computer hardware and monitors', | |
'math, language, meditation and education', | |
'cars and entertainment', | |
'bing, google, facebook, search engines', | |
'transportation and military', | |
'technology in the media and society', | |
'finance and bitcoin', | |
'higher education, business and grad schools', | |
'sleep, stimulants, and excercise', |