注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。
启动新会话:
tmux [new -s 会话名 -n 窗口名]
恢复会话:
| import torch | |
| import torch.nn as nn | |
| import torch.nn.init as init | |
| dropout_prob = 0.5 | |
| class FlatCnnLayer(nn.Module): | |
| def __init__(self, embedding_size, sequence_length, filter_sizes=[3, 4, 5], out_channels=128): | |
| super(FlatCnnLayer, self).__init__() |
| import torch | |
| import torch.nn as nn | |
| import numpy as np | |
| import torch.optim as optim | |
| from torch.autograd import Variable | |
| # (1, 0) => target labels 0+2 | |
| # (0, 1) => target labels 1 | |
| # (1, 1) => target labels 3 | |
| train = [] |
| import ipdb | |
| import numpy as np | |
| import numpy.linalg as nl | |
| import matplotlib.pyplot as plt | |
| from scipy.spatial.distance import pdist, cdist, squareform | |
| def makeT(cp): | |
| # cp: [K x 2] control points | |
| # T: [(K+3) x (K+3)] | |
| K = cp.shape[0] |
| import nltk | |
| text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital | |
| computer or the gears of a cycle transmission as he does at the top of a mountain | |
| or in the petals of a flower. To think otherwise is to demean the Buddha...which is | |
| to demean oneself.""" | |
| # Used when tokenizing words | |
| sentence_re = r'''(?x) # set flag to allow verbose regexps | |
| ([A-Z])(\.[A-Z])+\.? # abbreviations, e.g. U.S.A. |