from data_processor import iflatten_complex_data from data_processor import time_stamp from data_processor import trim_data from dynamic_reporter import init_dynamic_report from dynamic_reporter import stop_dynamic_report from dynamic_reporter import report from data_reader import write_one_file from multiprocessing import set_start_method import random import os # Prepare the training set for this model print('Preparing the training set...') if config.TRIM_LENGTH is None: set_trim_length(300) fft_all_data() data = trim_data(standardize_all_data()) train_set = flatten_real_data(data) print('Training set is ready!') class Complex_Fully_Connected_Discriminator(nn.Module): def __init__(self, dimension): super(Complex_Fully_Connected_Discriminator, self).__init__() self.n_in = dimension * config.TRIM_LENGTH # hidden linear layers self.linear1 = nn.Linear(self.n_in, self.n_in) self.linear2 = nn.Linear(self.n_in, self.n_in) self.linear3 = nn.Linear(self.n_in, 1) self.drop_layer = nn.Dropout(0.87)
from data_processor import time_stamp from data_processor import trim_data from dynamic_reporter import init_dynamic_report from dynamic_reporter import stop_dynamic_report from dynamic_reporter import report from data_reader import write_one_file from multiprocessing import set_start_method import random import os # Prepare the training set for this model print('Preparing the training set...') if config.TRIM_LENGTH is None: set_trim_length(300) origin = trim_data(standardize_all_data()) data = fft_all_data() train_set = flatten_complex_data(data) print('Training set is ready!') class Complex_Fully_Connected_Linear_Discriminator(nn.Module): def __init__(self, dimension): super(Complex_Fully_Connected_Linear_Discriminator, self).__init__() self.n_in = dimension * (config.TRIM_LENGTH // 2 + 1) * 2 # real part and imaginary part are saperated # hidden linear layers self.linear1 = nn.Linear(self.n_in, self.n_in) self.linear2 = nn.Linear(self.n_in, self.n_in) self.linear3 = nn.Linear(self.n_in, self.n_in) self.linear4 = nn.Linear(self.n_in, 1) self.criterion = nn.BCELoss()
import config from data_reader import get_trajectory from data_processor import trim_data from scipy.fft import fft, fftfreq, ifft from data_analyzer import spectra_diff from data_processor import fft_all_data from data_analyzer import average_spectra_diff from config import set_trim_length from data_processor import standardize_all_data # %% set_trim_length(300) data = get_trajectory('Adam') data = trim_data(data) standardize_data() fft_all_data() # %% dataf = fft_data(data) X = dataf[0] Y = dataf[5] # %% X # %% Y # %% spectra_diff(X, Y) # %% R = [np.zeros((300, 6))] Rf = fft_data(R) # %%