I'm currently working on a Deep reinforcement learning problem, and I'm using the categorical distribution to help the agent get random action. This is the code.
def choose_action(self,enc_current_node,goal_node): #print('nn') #vector=self.convert_vector(observation,end) state=T.tensor([[enc_current_node,goal_node]],dtype=T.float) pi,v=self.forward(state) probs=T.softmax(pi,dim=1) print(probs) dist=Categorical(probs) action=dist.sample().numpy()[0]#take a sample from the categorical dist from 1-22 return action the output of the Categorical(props) like this:
probs=T.tensor([[1.5857e-03, 8.9753e-01, 2.8500e-03, 9.0585e-03, 3.6661e-04, 6.8342e-08, 7.2956e-04, 3.3966e-05, 3.7150e-04, 1.8317e-05, 4.1543e-04, 4.7550e-05, 5.2323e-05, 1.1337e-03, 1.6356e-05, 6. Read More...
Net Worth: $8 Million Date of Birth: Jan 4, 1963 (58 years old) Gender: Male Height: 6 ft (1.84 m) Profession: Singer, Musician, Actor, Poet, Pyrotechnician Nationality: Germany Till Lindemann net worth: Till Lindemann is a German musician, composer, and poet who has a net worth of $8 million. Till Lindemann was born in Leipzig, Saxony, East Germany. He was a strong athlete during childhood and attended a sports school. Read More...
What is the main happy chemical? The four main happiness chemicals are serotonin, dopamine, endorphins and oxytocin. Each one has an impact on happiness, with effects ranging from boosting pleasure and satisfaction to controlling stress and anxiety. How do I make my brain chemicals happy? You can trigger more happy chemicals naturally.Here’s how. Dopamine (Embrace a new goal) Approaching a reward triggers dopamine. … Serotonin (Believe in yourself) … Oxytocin (Build trust consciously) … Endorphin (Make time to stretch and laugh) … Cortisol (Survive, then thrive) Building New Happy Habits. Read More...