-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathge_main_kfold.py
44 lines (31 loc) · 958 Bytes
/
ge_main_kfold.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import h5py
import sys
import csv
import matplotlib.pyplot as plt
import time
import ge_train
import ge_test
#データ
#ここを買えたらge_nnのn_targetsの数を変更してくださいseq->10, l131k_w128->4229
data = h5py.File('/home/abe/data/genome_data/l131k_w128.h5')
#data = h5py.File('/home/abe/data/genome_data/seq.h5')
#data = h5py.File('/Users/nemomac/gelp/dataset/seq.h5')
#data = h5py.File('/Users/nemomac/gelp/dataset/l131k_w128.h5')
n_targets = 4229
#使用GPU
#0-7
args = sys.argv
n_device = int(args[1])
#学習率
#lr = 0.001
#エポック数
n_epochs = 200
#バッチサイズ
batchsize = 64
#交差検証分割数
k_fold = 6
bestmodel_number = ge_train.ge_train_fun_kfold(data, n_device, n_epochs, batchsize, n_targets, k_fold)
print(bestmodel_number)
model_path = './model_checkpoint/checkpoint_fold{}.pth'.format(bestmodel_number)
#モデル評価
ge_test.ge_test_fun(data, n_device, batchsize, n_targets, model_path)