 Packages

import gym
import random
import torch
import numpy as np
from collections import deque
import matplotlib.pyplot as plt
# %matplotlib inline

# ### 2. Instantiate the Environment and Agent
#
# Initialize the environment in the code cell below.

env = gym.make('LunarLander-v2')
env.seed(0)
print('State shape: ', env.observation_space.shape)
print('Number of actions: ', env.action_space.n)

# Before running the next code cell, familiarize yourself with the code  `dqn_agent.py` and `model.py`.  
# Define a neural network architecture in `model.py` that maps states to action values.

# +
from dqn_agent import Agent

agent = Agent(state_size=8, action_size=4, seed=0)


# -

# ### 3. Train the Agent with DQN
#
# Run the code cell below to train the agent from scratch.

# +
def dqn(n_episodes=2000, max_t=1000, eps_start=1.0, eps_end=0.01, eps_decay=0.995):
    """Deep Q-Learning.
    
    Params
    ======
        n_episodes (int):  maximum number of training episodes
        max_t (int):       maximum number of timesteps per episode
        eps_start (float): starting value of epsilon, for epsilon-greedy action selection
        eps_end (float):   minimum value of epsilon
        eps_decay (float): multiplicative factor (per episode) for decreasing epsilon
    """
    scores = []                        # list containing scores from each episode
    scores_window = deque(maxlen=100)  # last 100 scores
    eps = eps_start                    # initialize epsilon
    for i_episode in range(1, n_episodes+1):
        state = env.reset()
        score = 0
        for t in range(max_t):
            action = agent.act(state, eps)
            next_state, reward, done, _ = env.step(action)
            agent.step(state, action, reward, next_state, done)
            state = next_state
            score += reward
            if done:
                break 
        scores_window.append(score)       # save most recent score
        scores.append(score)              # save most recent score
        eps = max(eps_end, eps_decay*eps) # decrease epsilon
        print('\rEpisode {}\tAverage Score: {:.2f}'.format(i_episode, np.mean(scores_window)), end="")
        if i_episode % 100 == 0:
            print('\rEpisode {}\tAverage Score: {:.2f}'.format(i_episode, np.mean(scores_window)))
        if np.mean(scores_window)>=200.0:
            print('\nEnvironment solved in {:d} episodes!\tAverage Score: {:.2f}'.format(i_episode-100, np.mean(scores_window)))
            torch.save(agent.qnetwork_local.state_dict(), 'F-checkpoint.pth')
            break
    return scores

scores = dqn()

# plot the scores
fig = plt.figure()
ax = fig.add_subplot(111)
plt.plot(np.arange(len(scores)), scores)
plt.ylabel('Score')
plt.xlabel('Episode #')
plt.show()
# -

torch.save(agent.qnetwork_local.state_dict(), 'F-checkpoint.pth')

# ### Rendering
#

# +
# load the weights from file
agent.qnetwork_local.load_state_dict(torch.load('F-checkpoint.pth'))

for i in range(200):
    state = env.reset()
    for j in range(200):
        action = agent.act(state)
        env.render()
        state, reward, done, _ = env.step(action)
        if done:
            break 
            
env.close()
# -


It is known the Ajith plays the role of Vinayak Mahadevan in Mankatha but with an ensemble cast we were wondering what kind of roles the others have. When the director was quizzed about this he said that Arjun plays the role of a cop who is on the lookout for the bad boys. His role is said to be extremely powerful and the director said that there is no one else who can do a cop role better than Arjun.
When asked about the four pretty ladies in the film Venkat Prabhu did not disclose any details but said that it was nice of them all to accept this film despite knowing it is male dominated. So, will we see very less of these ladies? Only time will tell.
Ajith’s Mankatha directed by Venkat Prabhu is in the last leg of shoot with just a fight sequence and a song pending. The fight sequence is to be shot in Bangkok and the director has selected a very few members from the cast and crew to travel along with him as he plans to finish the sequence in a go.
Venkat Prabhu wanted to release the movie or the audio on Ajith’s birthday (1st May) but he could do neither and so he released a song teaser much to the fans delight.Ajith was seen sporting a salt and pepper look like George Clooney and his character named Vinayak Mahadevan is said to have shades of gray. We sure hope the Bangkok schedule gets over quick as a wink and we get to see the movie soon.One of the most pure and deeply inspirational relationships is that of a devoted teacher and willing students. Almost everyone has a favorite and those we liked less, it totally depends on how the student teacher relationship were developed, nurtured and given space to evolve.
According to Whitaker (2005), the main variable in the classroom is not the student, but the teacher. Great teachers have high expectations for their students, but even higher expectations for themselves. These teachers recognize the importance of connecting with their students, that if they are unable to connect with them emotionally then influencing their minds may be impossible.
“Good teachers put snags in the river of children passing by, and over time, they redirect hundreds of lives… There is an innocence that conspires to hold humanity together …” (Bolman & Deal, 2005, p. 124).
“A fundamental question for a student is ‘Does my teacher like me?’ Given a rigorous, aligned curriculum, the answer to that simple question is our best predictor of student achievement” (Terry, 2008).
Teacher knowledge and efficacy of student motivation and achievement are crucial components to creating relationships that motivate. Both teachers and students have to value their contribution. A student has to feel worthwhile and appreciated. A teacher needs to recognize that he or she can have a positive effect on their students. Wise man and Hunt (2005) refer to this as “teacher efficacy” and note that the more the teacher believes in this, the more they will cause it to happen.
Students are influenced by perceptions of their teacher’s even handedness, competence, caring and support as well as the nature of the teacher-student relationship that results (Stipek, 2005). A student wants to feel connected to people and to feel as though he or she deserves to be loved and respected (Stipek, 2005). According to Stipek many of the students who are not doing well academically, are the same ones who have a poor relationship with their teachers. Typically, the more they fall behind academically, often, the more this relationship is weakened. If they are constantly remains back in class, the environment and the teacher-student relationship (STR) begin to hold negative associations. Students who perceived a more nurturing relationship with their teachers tended to have better attitudes towards academics and often did better than their peers who lacked the same support system.
Some other researches supported the idea that a good teacher-student relationship positively influenced learning. The more connected a child feels, the more they are willing to attempt tasks and to seek help when necessary. The student who feels this sense of connectedness may want to maintain it or please the teacher by doing well in class.
Positive teacher expectations were associated with high academic performance or academic gains, whereas negative teacher expectations resulted in decrease in academic performance. The significance of knowing teacher’s beliefs regarding their roles in student motivation is crucial due to the accepted correlation between this perception and actions.
“The quality of teacher–student relationships is the keystone for all other aspects of classroom management” (Marzano & Marzano, 2008,).
Reinforcement theorists argue that motivation is in the environment, not in the person such as the teacher (Stipek, 2005). However, it is the teacher who plays the greatest role in setting the atmosphere (Whitaker, 2005). Whitaker (2005) argues that it is better to create the relationship that will motivate the student to behave well. School climate and culture will enable or