wod generator
1.0.0
이 코드는 순환 신경망(Andrej Karpathy의 char-rnn 모델)을 사용하여 CrossFit WOD(오늘의 운동)를 생성합니다. 네트워크는 다양한 크로스핏 상자에서 수집된 5,000개의 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