delta [lgr_s[lgr_c for in range ( , - ) , dci_dbl delta [ldci_dwl delta [la[ - ---sum up over samples ---dc_db [ldc_db [ldci_dbl / dc_dw [ldc_dw [ldci_dwl / delta [ - gr_s[ - [lt delta [lreturn dc_dw dc_db loss as explained in section it is sometimes more convenient to collect all the weight matrices and bias vectors {wl bl } = into single vector th consequentlywe code two functions that map the weight matrices and the bias vectors into single parameter vectorand vice versa def list vec ( , )converts list of weight matrices and bias vectors into one column vector b_stack np vstack ([ [ifor in range ( len( ))w_stack np vstack ( [iflatten (reshape - , for in range ( len( ))vec np vstack (b_stack w_stack ]return vec #%def vec list (vec )converts vector to weight matrices and bias vectors wb [[]]len( ,[[]]len(pp_count for in range ( len( ))construct bias vectors [lvecp_count :p_count + [ ]reshape - , p_count p_count [lfor in range ( len( ))construct weight matrices [lvecp_count :p_count [ ]* [ - ]reshape ( [ ]pl - ]p_count p_count ( [ ]* [ - ]return wb finallywe run the stochastic gradient descent for iterations using minibatch of size and constant learning rate of at batch_size lr beta list vec ( ,bloss_arr [