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 math | |
import random | |
def dice(num, size): | |
return sum(random.randint(1, size) for _ in range(num)) | |
class Character: | |
def damage(self, amount): |
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
let links = document.getElementsByClassName('nav-reverse'); | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
for (let i=0; i<links.length; i++) { | |
let l = links[i] | |
if (l.innerText === 'Download' || l.innerText === 'ダウンロード') { | |
l.click(); | |
await sleep(500); | |
} |
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 | |
from typing import Tuple, Union | |
from .autopackingrnn import AutoPackingRNN | |
FloatType = Union[torch.FloatTensor, torch.cuda.FloatTensor] | |
LongType = Union[torch.LongTensor, torch.cuda.LongTensor] |
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.utils.data as D | |
from myutils.data import EmbeddingLoader, CompositeConverter, TextDataset, \ | |
ParallelDataset, ParallelCollate, lowercase, tokenize_with_bos_and_eos | |
emb_en = EmbeddingLoader('/cl/work/michael-l/multiembed/en.multiCCA.512.embedding', 512) | |
emb_de = EmbeddingLoader('/cl/work/michael-l/multiembed/de.multiCCA.512.embedding', 512) | |
converter = CompositeConverter(lowercase, tokenize_with_bos_and_eos) | |
news_en = emb_en.process_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
Alos | |
Amu | |
Ardol | |
Argola | |
Aricheo | |
Arite | |
Arlele | |
Arma | |
Armara | |
Armile |
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 _dynet as dy | |
import numpy as np | |
from collections import OrderedDict | |
# End of word token. | |
EOW = "<EOW>" | |
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
const templates = { | |
"Humanoid traits": [ | |
"with [genericadj+limbadj] [limbs]", | |
"with a missing [limb+appendage+face]", | |
"with [genericadj+eyeadj] eyes", | |
"wearing @[jewelryadj] [jewelry]", | |
"with [hairadj] hair", | |
"with @[voiceadj] voice" | |
], | |
"Mammalian traits": [ |