Last active
December 4, 2025 15:51
-
-
Save matthiasplappert/7860effd77d533e54797b4bdc277b4cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import gym | |
| env = gym.make('FetchReach-v0') | |
| obs = env.reset() | |
| done = False | |
| def policy(observation, desired_goal): | |
| # Here you would implement your smarter policy. In this case, | |
| # we just sample random actions. | |
| return env.action_space.sample() | |
| while not done: | |
| action = policy(obs['observation'], obs['desired_goal']) | |
| obs, reward, done, info = env.step(action) | |
| # If we want, we can substitute a goal here and re-compute | |
| # the reward. For instance, we can just pretend that the desired | |
| # goal was what we achieved all along. | |
| substitute_goal = obs['achieved_goal'].copy() | |
| substitute_reward = env.compute_reward( | |
| obs['achieved_goal'], substitute_goal, info) | |
| print('reward is {}, substitute_reward is {}'.format( | |
| reward, substitute_reward)) |
print("كاتبه سليم")
day = input("What day is it today? ") temperature = input("What is the temperature? ")
print("Today is", day, "and the temperature is", temperature)
Documents $ python3 example.py
صباح عوده
What day is it today? Wednesday
What is the temperature? 23
Today is Wednesday and the temperature is 23
Documents $
Documents $ python3 example.py
صباح عوده
What day is it today? Wednesday
What is the temperature? 23
Today is Wednesday and the temperature is 23
Documents $
print("كاتبه سليم")
day = input("What day is it today? ") temperature = input("What is the temperature? ")
print("Today is", day, "and the temperature is", temperature)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
apikey