diff --git a/data_viz.py b/data_viz.py index 52fd3095cda563f91c9a055a39ad2ef1c8c4740b..3d0f590b2006daec7cc598eb6a84494fe004d2d4 100644 --- a/data_viz.py +++ b/data_viz.py @@ -234,5 +234,5 @@ df = pd.read_csv('output/out_ISA.csv') add_length(df) df['abs_error'] = np.abs(df['rt pred']-df['true rt']) # histo_abs_error(df, display=False, save=True, path='temp.png') -# scatter_rt(df, display=False, save=True, path='temp.png') -histo_length_by_error(df, 10, save=True, path='temp.png') \ No newline at end of file +scatter_rt(df, display=False, save=True, path='temp.png') +# histo_length_by_error(df, 10, save=True, path='temp.png') \ No newline at end of file diff --git a/main_custom.py b/main_custom.py index fcc907494f8c2419cfd47376f0c5a9f4fac3a94c..db984b4baa652a0b7f364dd7c1ffacd5d81c3f87 100644 --- a/main_custom.py +++ b/main_custom.py @@ -207,7 +207,7 @@ def main(args): print('\nData loaded') - model = Model_Common_Transformer_TAPE(encoder_ff=args.encoder_ff, decoder_rt_ff=args.decoder_rt_ff, + model = Model_Common_Transformer(encoder_ff=args.encoder_ff, decoder_rt_ff=args.decoder_rt_ff, decoder_int_ff=args.decoder_int_ff , n_head=args.n_head, encoder_num_layer=args.encoder_num_layer, decoder_int_num_layer=args.decoder_int_num_layer, diff --git a/vector_sim_test.py b/vector_sim_test.py new file mode 100644 index 0000000000000000000000000000000000000000..1adb08082125225f3b2ca5d09bac1ab274b9f57c --- /dev/null +++ b/vector_sim_test.py @@ -0,0 +1,27 @@ +import numpy as np +import matplotlib.pyplot as plt + +def cos_sim(a,b): + return (a.dot(b))/(np.linalg.norm(a)*np.linalg.norm(b)) + +l10=[] +l100=[] +for _ in range(1000): + vec10 = np.random.random(10) + vec10b = vec10 + np.random.random(10) + + l10.append(cos_sim(vec10,vec10b)) + + vec100 = np.random.random(100) + vec100b = vec100 + np.random.random(100) + + l100.append(cos_sim(vec100,vec100b)) + + +fig, ax = plt.subplots() + +ax.plot(l10,c='b',ls='',marker='.') +ax.plot(l100,c='y',ls='',marker='.') +plt.savefig('temp.png') +print(np.mean(l10)) +print(np.mean(l100)) \ No newline at end of file