***************************************************** * ready.asm for use with rtrl_dsp.c * This file should be compiled and placed BEFORE * the main() function of the code composer program. * * .sect ".ready" * LDI 1000h, ST ; clear the cache NOP NOP NOP NOP * OR 00100000000000b,ST ; enable the cache NOP NOP NOP NOP LDP 800000h ; change page pointer to 100000h range OR 00000010b,IOF ; make XF0 Output OR 00100000b,IOF ; make XF1 Output NOP NOP NOP NOP ********************************************************************* N0 .set 104 ; number of input neurons N1 .set 5 ; number of hidden layers N2 .set 3 ; number of outputs .sect "weights" .global _W1_array,_W2_array,_b1_array,_b2_array,_Wf_array _W1_array .loop (N1*N0) .float 0.001 .endloop _b1_array .loop (N1) .float 0.001 .endloop _W2_array .loop (N2*N1) .float 0.001 .endloop _b2_array .loop (N2) .float 0.001 .endloop _Wf_array .loop (N1*N1) .float 0.001 .endloop .sect "allocate" .global _G_W1_asm,_G_b1_asm,_G_W2_asm,_G_b2_asm,_G_Wf_asm _G_W1_asm .space (N1*N0) ;/* gradient updates for above */ _G_b1_asm .space (N1*1) ; _G_W2_asm .space (N2*N1) ; _G_b2_asm .space (N2*1) ; _G_Wf_asm .space (N1*N1) ; .global _U_W1_asm,_U_b1_asm,_U_W2_asm,_U_b2_asm,_U_Wf_asm _U_W1_asm .space (N1*N0) ;/* weight updates for above */ _U_b1_asm .space (N1*1) ; _U_W2_asm .space (N2*N1) ; _U_b2_asm .space (N2*1) ; _U_Wf_asm .space (N1*N1) ; .global _c_asm,_g_asm,_h_asm _c_asm .space (N1*N1) ;/* intermediate update parameters */ _g_asm .space (N1*N1*N0) ; _h_asm .space (N1*N1*N1) ; .global _z1_asm,_Y1_asm,_y2_asm,_e_asm,_a_asm,_temp_asm _z1_asm .space (N1*1) ;/* input to hidden layer */ _Y1_asm .space (N1*1) ;/* output of hidden layer */ _y2_asm .space (N2*1) ;/* network output */ _e_asm .space (N2*1) ;/* network error */ _a_asm .space (N1*1) ;/* save sech(z1)^2 */ _temp_asm .space (N1*1) ; .sect "state" .global _y1p_asm,_y1p_save_asm _y1p_save_asm ;/* previous Y1, hidden state, saved */ .loop (N1*1) .float 0.0 .endloop _y1p_asm ;/* previous Y1, hidden state */ .loop (N1*1) .float 0.0 .endloop .sect "flags" ; reserve space for PC-to-DSP parameter passing .global _chunkMSE_Begin,_chunkMSE_End,_changeETA1,_changeETA2,_changeETAF _chunkMSE_End .float (0.0) ; MSE at end of chunk _changeETA1 .float (0.0) ; new step size _changeETA2 .float (0.0) ; new step size _changeETAF .float (0.0) ; new step size ********************************************************************* .sect "input" .global _input_array _input_array .include "xt1_norm_1-3000.asm" .sect "desired" .global _desired_array _desired_array .include "pr_norm_1-3000.asm" *********************************************************************