|
129 | 129 |
|
130 | 130 | # In[Plot]
|
131 | 131 | plt.figure()
|
132 |
| - plt.plot(t_fit, y_fit, 'k', label="$y$") |
133 |
| - plt.plot(t_fit, y_hidden, 'b', label="$\hat y$") |
134 |
| - plt.plot(t_fit, y_lin, 'r', label="$y_{lin}$") |
| 132 | + plt.plot(t_fit, y_fit, 'k', label="$y_{true}$") |
| 133 | + plt.plot(t_fit, y_hidden, 'b', label="$y_{FB}$") |
| 134 | + plt.plot(t_fit, y_lin, 'r', label="$y_{hat}$") |
135 | 135 | plt.legend()
|
| 136 | + plt.savefig(os.path.join(model_folder,'Feedback_fit.pdf')) |
136 | 137 | plt.show()
|
137 | 138 |
|
138 | 139 | plt.figure()
|
139 |
| - plt.plot(LOSS) |
140 |
| - plt.plot(LOSS_FIT) |
141 |
| - plt.plot(LOSS_CONSISTENCY) |
| 140 | + plt.plot(LOSS, label='Total Loss') |
| 141 | + plt.plot(LOSS_FIT, label='Output Loss') |
| 142 | + plt.plot(LOSS_CONSISTENCY, label='Feedback Loss') |
142 | 143 | plt.grid(True)
|
| 144 | + plt.legend() |
| 145 | + plt.savefig(os.path.join(model_folder,'Feedback_train_loss.pdf')) |
143 | 146 | plt.show()
|
144 | 147 |
|
145 | 148 | # In[Plot static non-linearity]
|
|
155 | 158 | plt.figure()
|
156 | 159 | plt.plot(in_nl, out_nl, 'b')
|
157 | 160 | #plt.plot(y1_lin, y1_nl, 'b*')
|
158 |
| - plt.xlabel('Static non-linearity input (-)') |
159 |
| - plt.ylabel('Static non-linearity input (-)') |
| 161 | + plt.xlabel('Static non-linearity input (hat)') |
| 162 | + plt.ylabel('Static non-linearity output (hat)') |
160 | 163 | plt.grid(True)
|
| 164 | + plt.savefig(os.path.join(model_folder,'F1_lin.pdf')) |
161 | 165 | plt.show()
|
162 | 166 |
|
163 | 167 | idx_plot_nl = np.abs(in_nl) > 0.02
|
|
166 | 170 | plt.figure()
|
167 | 171 | plt.plot(in_nl[idx_plot_nl], out_nl[idx_plot_nl]/in_nl[idx_plot_nl], 'b')
|
168 | 172 | plt.plot(y_hidden[idx_plot_h], y_nl[idx_plot_h] / y_hidden[idx_plot_h], 'b*')
|
169 |
| - plt.xlabel('Static non-linearity input (-)') |
170 |
| - plt.ylabel('Static non-linearity input (-)') |
| 173 | + plt.xlabel('Static non-linearity input (FB)') |
| 174 | + plt.ylabel('Static non-linearity output (FB)') |
| 175 | + plt.savefig(os.path.join(model_folder,'F1_FB.pdf')) |
171 | 176 | plt.grid(True)
|
172 | 177 | plt.show()
|
173 | 178 |
|
|
0 commit comments