Exemplo n.º 1
0
	def get_training_data(self):
		waves = waveUtils.generateRandomFrequencies(self.input_s, num=self.num_freqs, freq_min=self.min_freq, freq_max=self.max_freq, num_to_combine=4)
		all_data = []
		all_originals = []
		for i in range(len(waves)):
			for j in range(i+1, len(waves)):
				all_data.append(waves[i]+waves[j])
				all_originals.append([waves[i], waves[j]])
                num_samples = len(all_data)
                perm = np.random.permutation(num_samples)
                all_data = np.asarray(all_data)[perm]
                all_originals = np.asarray(all_originals)[perm]
		self._val_data = all_data[:self.validation_samples]
		self._val_originals = all_originals[:self.validation_samples]
		return all_data[self.validation_samples:], all_originals[self.validation_samples:]
Exemplo n.º 2
0
 def get_training_data(self):
     waves = waveUtils.generateRandomFrequencies(self.input_s,
                                                 self.num_freqs,
                                                 self.min_freq,
                                                 self.max_freq)
     all_data = []
     all_originals = []
     for i in range(len(waves)):
         for j in range(i, len(waves)):
             all_data.append(waves[i] + waves[j])
             all_originals.append([waves[i], waves[j]])
     self._val_data = np.asarray(all_data[:self.validation_samples])
     self._val_originals = np.asarray(
         all_originals[:self.validation_samples])
     return np.asarray(all_data[self.validation_samples:]), np.asarray(
         all_originals[self.validation_samples:])