मैं एक सुदृढीकरण सीखने के कार्यक्रम में काम कर रहा हूं और मैं इस लेख का उपयोग reference के रूप में कर रहा हूं। मैं तंत्रिका नेटवर्क और मैं इस कार्यक्रम के लिए उपयोग कर रहा हूँ छद्म कोड बनाने के लिए 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 (रों ',' एक) = 0.8375 और क्यू (रों, एक) = 0,6892
मेरे एल होगा 1/2*(1+0.8375-0.6892)^2=0.659296445
अब मैं अपने मॉडल तंत्रिका नेटवर्क से ऊपर नुकसान समारोह मूल्य का उपयोग कर वजन अद्यतन करना चाहिए अगर मेरे मॉडल संरचना इस
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