return chainer.get_device(numpy) else: import cupy return chainer.get_device((cupy, gpu)) return chainer.get_device(args.device) """ 3. Import datasets データセット読み込み FBGセンサから取得した脈波データ 参照血糖値 """ # 1,000datas data, teach = easy_chainer.load_Data("C:/Users/Owner/Desktop/Normalized/val/val_ebina_day1.xlsx") data = data.astype(numpy.float32) teach = teach print(teach) print(teach.shape) # 回帰させるときに必要(分類はint型) teach = teach.astype(numpy.float32) id_all = numpy.arange(1, len(teach) + 1, 1).astype(numpy.int32) - 1 # print(id_all) numpy.random.seed(11) id_train = numpy.random.choice(id_all, 400, replace=False) #重複なし print(id_train) id_test = numpy.delete(id_all, id_train) print(id_test)
if gpu is not None: if gpu < 0: return chainer.get_device(numpy) else: import cupy return chainer.get_device((cupy, gpu)) return chainer.get_device(args.device) """ 3. データセットのインポート """ # 1,000datas data, teach = easy_chainer.load_Data( "C:/Users/Owner/Desktop/arteries/excel/black.xlsx") data = data.astype(numpy.float32) teach = teach.astype(numpy.float32) all_data_number = len(teach) print(teach) print(teach.shape) # 教師値にidを割り振る id_all = numpy.arange(1, len(teach) + 1, 1).astype(numpy.int32) - 1 print(id_all) # seedは適当 # 訓練に使うデータ数はその時の最適なもので numpy.random.seed(11) id_train = numpy.random.choice(id_all, 300, replace=False) # print(id_train)
gpu = int(args.device) if gpu is not None: if gpu < 0: return chainer.get_device(numpy) else: import cupy return chainer.get_device((cupy, gpu)) return chainer.get_device(args.device) """ 3. データセットのインポート """ # 1,000datas data, teach = easy_chainer.load_Data("C:/Users/Owner/Desktop/Normalized/val/new2_1.xlsx") data = data.astype(numpy.float32) teach = teach all_data_number = len(teach) print(teach) print(teach.shape) teach = teach.astype(numpy.float32) # print(data.shape) # 教師値にidを割り振る id_all = numpy.arange(1, len(teach) + 1, 1).astype(numpy.int32) - 1 print(id_all) # seedは適当 # 訓練に使うデータ数はその時の最適なもので
if args.gpu is not None: gpu = args.gpu elif re.match(r'(-|\+|)[0-9]+$', args.device): gpu = int(args.device) if gpu is not None: if gpu < 0: return chainer.get_device(numpy) else: import cupy return chainer.get_device((cupy, gpu)) return chainer.get_device(args.device) data, teach = easy_chainer.load_Data("/home/fiber_classifier/Desktop/blood_glucose_fulldata.xlsx") data = data.astype(numpy.float32) teach = teach #print(teach) print(teach.shape) # 回帰させるときに必要(分類はint型) teach = teach.astype(numpy.float32) id_all = numpy.arange(1, len(teach) + 1, 1).astype(numpy.int32) - 1 print(id_all.shape) numpy.random.seed(13) id_train_T = numpy.random.choice(id_all, 300, replace=False) #重複なし #print(id_train_T.dtype) id_test = numpy.delete(id_all, id_train_T)