wod generator
1.0.0
此代码使用循环神经网络(Andrej Karpathy 的 char-rnn 模型)生成 CrossFit WOD(每日锻炼)。该网络使用从各种 crossfit 盒子收集的 5k WOD 样本进行训练。尽管数据集很小,但结果既有趣又令人满意。
从这里可以看到一些好的结果的集合。
当然,并不是所有的结果都很好。这里有一些有趣的:
零WOD
0 rounds for time 15 minutes
800 mt run
10 sumo deadlift high pull
9 front squat
1 muscle-up
休息WOD
5 rounds for time
20 minutes rest
几乎不可能的WOD
5 rounds for time 20 minutes
100 double under
50 wall-ball
在此 WOD 中,没有行,但网络仍然希望在该行上进行波比跳
7 rounds for time
18 dumbbell squat clean
15 burpees over the row
250 mt run
一些想象练习
brusseane push-up
t-up
touster
lean & jerk
publ-up
dumbell burpee over the bar
hanging ring in
louble under
ode-hand dip
roundstand walk
tempo kim back extension
muscle sprint
pistol squat snatch
over clean
elite push-up
inverted barbell
rest clean
pill-up
所有 WOD 均收集自:
收集后,所有 WOD 均经过手工语法规范化。这就是为什么数据集那么小,我希望提供更多的 WOD,但所有源都使用不同的格式,有些使用缩写,有些则不使用。为了获得最佳结果,整个数据集应采用相同的格式。
数据集可以在data/wods.txt
中找到,或者更好地在位于db.sqlite
的 sqlite 数据库的wod
表中找到。请随意使用它。
要求:
> cd char-rnn
> python train.py --help
usage: train.py [-h] [--input_file INPUT_FILE] [--rnn_size RNN_SIZE]
[--num_layers NUM_LAYERS] [--model MODEL]
[--batch_size BATCH_SIZE] [--seq_length SEQ_LENGTH]
[--num_epochs NUM_EPOCHS] [--log_step LOG_STEP]
[--grad_clip GRAD_CLIP] [--learning_rate LEARNING_RATE]
[--decay_rate DECAY_RATE]
[--input_dropout_keep_prob INPUT_DROPOUT_KEEP_PROB]
[--output_dropout_keep_prob OUTPUT_DROPOUT_KEEP_PROB]
[--train_root_dir TRAIN_ROOT_DIR] [--vocab_size VOCAB_SIZE]
optional arguments:
-h, --help show this help message and exit
--input_file INPUT_FILE
Input text file to train on
--rnn_size RNN_SIZE The size of RNN hidden state
--num_layers NUM_LAYERS
The number of layers in the RNN
--model MODEL RNN model: rnn, gru, lstm, or nas
--batch_size BATCH_SIZE
Batch size
--seq_length SEQ_LENGTH
RNN sequence length
--num_epochs NUM_EPOCHS
Number of epochs for training
--log_step LOG_STEP Logging period in terms of iteration
--grad_clip GRAD_CLIP
Clip gradients value
--learning_rate LEARNING_RATE
Learning rate for adam optimizer
--decay_rate DECAY_RATE
Learning rate for adam optimizer
--input_dropout_keep_prob INPUT_DROPOUT_KEEP_PROB
Input dropout keep probability
--output_dropout_keep_prob OUTPUT_DROPOUT_KEEP_PROB
Output dropout keep probability
--train_root_dir TRAIN_ROOT_DIR
Root directory to put the training data
> cd char-rnn
> python sample.py --help
usage: sample.py [-h] [--data_dir DATA_DIR] [--seperator_char SEPERATOR_CHAR]
[--num_sample NUM_SAMPLE] [--save_to_db [SAVE_TO_DB]]
[--nosave_to_db]
optional arguments:
-h, --help show this help message and exit
--data_dir DATA_DIR Training data directory. If empty, latest folder in
training/ folder will be used
--seperator_char SEPERATOR_CHAR
WOD item seperator character, default `|`
--num_sample NUM_SAMPLE
The number of WODs to be sampled, default 1
--save_to_db [SAVE_TO_DB]
Should save into sqlite, default false
--nosave_to_db