reference: https://stackoverflow.com/a/52112850/10214604
$apt install r-base
$vim 1.r
r = getOption("repos")
r["CRAN"] = "http://cran.us.r-project.org"
options(repos = r)
""" | |
讓encoder能disentangleword跟style才會學得好 像fontgan那樣 | |
相同的word/style的embedding要接近,用F.pairwise_distance | |
然後要能decode出來,用l1_loss, | |
""" | |
class Encoder(nn.Module): | |
def __init__(): | |
self.encoder = Encoder() | |
self.style = nn.Linear() |
import random | |
import numpy as np | |
import torch | |
def set_seed(seed): | |
random.seed(seed) | |
np.random.seed(seed) | |
torch.manual_seed(seed) | |
torch.cuda.manual_seed_all(seed) | |
torch.backends.cudnn.deterministic = True | |
torch.backends.cudnn.benchmark = False |
from argparse import ArgumentParser | |
def main(args): | |
if __name__ == '__main__': | |
parser = ArgumentParser() | |
parser.add_argument('--int', type=int, default=0, help='') | |
parser.add_argument('--str', type=str, default='', help='') | |
parser.add_argument('--action', action='store_true', help='') | |
args = parser.parse_args() | |
# args = parser.parse_args('') if in jupyter notebook |
reference: https://stackoverflow.com/a/52112850/10214604
$apt install r-base
$vim 1.r
r = getOption("repos")
r["CRAN"] = "http://cran.us.r-project.org"
options(repos = r)
Usage (Official Repo): | |
https://github.com/magnumripper/JohnTheRipper | |
Ubuntu Install Guide: | |
https://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/doc/INSTALL-UBUNTU | |
Other install guides can be found in: | |
https://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/doc/ | |
https://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/doc/INSTALL | |
https://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/doc/INSTALL-FEDORA |
local_account@local_hostname$ ssh -L 12345:0.0.0.0:12345 remote_account@remote_hostname | |
remote_account@remote_hostname$ python -m http.server 12345 | |
# open http://localhost:12345/ on local computer browser |
import json | |
def read_json(path, encoding = 'utf-8'): | |
with open(path, encoding = encoding) as f: | |
return json.load(f) | |
def write_json(data, path, encoding = 'utf-8'): | |
with open(path, 'w', encoding = encoding) as f: | |
return json.dump(data, f) |
conda install -c conda-forge julia
conda activate julia
conda install notebook
julia # use julia REPL to install IJulia (necessary)
> using Pkg
> Pkg.add("IJulia")
# Copyright The PyTorch Lightning team. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
import shelve | |
import time | |
# initialize | |
with shelve.open('shelvedb') as db: | |
for i in range(10000): | |
db[f'{i}'] = '{i*2}' | |
# no caching | |
with shelve.open('shelvedb') as db: | |
tic = time.time() |