2019/011 강화학습, Exponentially weighted average계산하기 https://gist.github.com/imcomking/b1acbb891ac4baa69f32d9eb4c221fb9 def exponentially_weighted_matrix(discount, mat_len): DisMat = np.triu(np.ones((mat_len, mat_len)) * discount, k=1) DisMat[DisMat==0] = 1 DisMat = np.cumprod(DisMat, axis=1) DisMat = np.triu(DisMat) return DisMat def exponentially_weighted_cumsum(discount, np_data): DisMat = exponentially_weighted_matrix(discount, np_data.shape[0.. 2019. 1. 22. 이전 1 다음