Skip to content

Instantly share code, notes, and snippets.

View alphadl's full-sized avatar
🎯
Developing LLM & its applications

Liang Ding alphadl

🎯
Developing LLM & its applications
View GitHub Profile
@rvinas
rvinas / language_model.py
Last active April 11, 2023 14:58
Computing the probability of occurrence of a sentence with a LSTM model using Keras
# StackOverflow question: https://stackoverflow.com/questions/51123481/how-to-build-a-language-model-using-lstm-that-assigns-probability-of-occurence-f
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.layers import Embedding, LSTM, Dense
from keras.models import Sequential
import numpy as np
def prepare_sentence(seq, maxlen):
# Pads seq and slides windows
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active October 30, 2024 08:09 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话: