나는 보강 학습 프로그램에서 일하고 나는 reference로이 문서를 사용하고 있습니다. 내가 신경 네트워크와 나는이 프로그램을 위해 사용하고있는 의사 코드를 작성하기위한 keras (theano)와 파이썬을 사용하고 여기에 손실 함수 방정식이강화 학습을 위해 keras의 가중치를 업데이트하는 방법은 무엇입니까?
입니다
Do a feedforward pass for the current state s to get predicted Q-values for all actions.
Do a feedforward pass for the next state s’ and calculate maximum overall network outputs max a’ Q(s’, a’).
Set Q-value target for action to r + γmax a’ Q(s’, a’) (use the max calculated in step 2). For all other actions, set the Q-value target to the same as originally returned from step 1, making the error 0 for those outputs.
Update the weights using backpropagation.
입니다 내 보상 +1, MAXQ (S ', A') = 0.8375 및 Q (s는, a) = 0.6892
내 L가 될 것이다 1/2*(1+0.8375-0.6892)^2=0.659296445
이제 내 모델 구조는 NN은 Q 값 기능을 모델링되는 가정이
model = Sequential()
model.add(Dense(150, input_dim=150))
model.add(Dense(10))
model.add(Dense(1,activation='sigmoid'))
model.compile(loss='mse', optimizer='adam')
자세한 설명을 제공해주십시오. 감사 – RZK