注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。
启动新会话:
tmux [new -s 会话名 -n 窗口名]
恢复会话:
| #!/usr/bin/env python3.6 | |
| """ | |
| Outputs an .eps visualization of shuffling algorithm to stdout. | |
| Requires Python 3.6+ (for f-strings). | |
| """ | |
| import numpy as np | |
| def create(width, height): | |
| print(f"""%!PS-Adobe-3.0 EPSF-3.0 | |
| %%BoundingBox: 0 0 {width} {height} |
| # http://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html | |
| def exp_lr_scheduler(optimizer, epoch, init_lr=0.001, lr_decay_epoch=7): | |
| """Decay learning rate by a factor of 0.1 every lr_decay_epoch epochs.""" | |
| lr = init_lr * (0.1**(epoch // lr_decay_epoch)) | |
| if epoch % lr_decay_epoch == 0: | |
| print('LR is set to {}'.format(lr)) | |
| for param_group in optimizer.param_groups: |
| import numpy as np | |
| import gym | |
| from gym import wrappers | |
| from gym.spaces import Discrete, Box | |
| # ================================================================ | |
| # Policies | |
| # ================================================================ | |
| class DeterministicDiscreteActionLinearPolicy(object): |
| import gym | |
| import numpy as np, pandas as pd | |
| from sklearn.neural_network import MLPClassifier | |
| import matplotlib.pyplot as plt | |
| env = gym.make("MountainCar-v0") | |
| env.reset() |
| import numpy as np | |
| import gym | |
| from gym import wrappers | |
| from gym.spaces import Discrete, Box | |
| # ================================================================ | |
| # Policies | |
| # ================================================================ | |
| class DeterministicDiscreteActionLinearPolicy(object): |
| sudo yum install libmpc-devel mpfr-devel gmp-devel | |
| cd ~/Downloads | |
| curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O | |
| tar xvfj gcc-4.9.2.tar.bz2 | |
| cd gcc-4.9.2 | |
| ./configure --disable-multilib --enable-languages=c,c++ | |
| make -j 4 | |
| make install |
| from gensim import models | |
| sentence = models.doc2vec.LabeledSentence( | |
| words=[u'so`bme', u'words', u'here'], tags=["SENT_0"]) | |
| sentence1 = models.doc2vec.LabeledSentence( | |
| words=[u'here', u'we', u'go'], tags=["SENT_1"]) | |
| sentences = [sentence, sentence1] | |
| class LabeledLineSentence(object): |
Refer to https://clang-omp.github.io/ .
We need to install something:
brew install libiomp
brew install clang-ompThen we need to set the environment:
| #kill all processes containing run_zyli | |
| #short cut: | |
| pss run_zyli |cut -d " " -f 7 |xargs kill | |
| #original: | |
| ps -ef | grep run_zyli |cut -d " " -f 7 |xargs kill |