def __init__(self, x_data, y_data, iteration_number, feature, gpu = -1):
self.N = 5000
self.N_test = 766
self.total = self.N + self.N_test
self.emotion_weight = {0: self.total / 716, 1: self.total / 325, 2: self.total / 1383, 3: self.total / 743, 4: self.total / 2066, 5: self.total / 74, 6: self.total / 17, 7: self.total / 35, 8: self.total / 404, 9: self.total / 3}
self.label_precision = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0}
self.label_counter = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0}
self.label_data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
self.x_data = x_data.astype(np.float32)
self.y_data = y_data.astype(np.int32)
self.y_predict_data = []
scaler = preprocessing.StandardScaler()
self.x_data = scaler.fit_transform(self.x_data)
self.iteration_number = iteration_number
if feature == "IS2009":
self.input_layer = 384
elif feature == "IS2010":
self.input_layer = 1582
self.n_units = 256
self.output_layer = 10
self.batchsize = 25
self.model = L.Classifier(net.EmotionRecognitionVoice(self.input_layer, self.n_units, self.output_layer))
self.gpu = gpu
self.__set_cpu_or_gpu()
emotion_voice.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录