Answers.Body: <p>I guess it would always be better if you can reuse existing environments to make it work for yourself. Since most of the environment codes is anyway <a href="https://github.com/openai/gym" rel="nofollow noreferrer">opensourced</a>, you can always edit it to your liking.</p>
  <p>If you want a custom environment, you can add an environment to gym like <a href="https://towardsdatascience.com/creating-a-custom-openai-gym-environment-for-stock-trading-be532be3910e" rel="nofollow noreferrer">this</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-28T14:19:49.813Z
Answers.LastActivityDate: 2020-06-28T14:19:49.813Z
Answers.UserDisplayName: pecey
Answers.Body: <p>Gym environments were designed first of all as a <em>benchmark</em> for RL algorithms. Therefore, you should ask yourself: Do I want to benchmark my RL algorithm or do I want to solve my problem with RL?</p>
  <p>If the answer is &quot;I want to benchmark my algorithm&quot;, you should probably go with existing environments. Using existing environments as benchmarks you will be able to compare your algorithm with other existing approaches.</p>
  <p>If the answer is &quot;I want to solve my problem&quot;, then yes, perhaps the best way to continue is to build your custom environment.</p>
  <p>Finally, if you want to understand RL better, I would suggest to start with existing environments to gain a better grasp of RL concepts.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-14T19:16:48.237Z
Answers.LastActivityDate: 2023-08-14T19:16:48.237Z
Answers.UserDisplayName: penkovsky
Body: <p>I am inspired by the paper <a href="https://arxiv.org/abs/1611.01578" rel="nofollow noreferrer">Neural Architecture Search with Reinforcement Learning</a> to use reinforcement learning for optimizing a child network (learner). My meta-learner (controller or parent network) is an MLP and will take as the reward function a silhouette score. Its output is a vector of real numbers between 0 and 1. These values are k different possibilities for the number of clusters (the goal is to cluster the result of the child network which is an auto-encoder, embedded images are the input to the meta-learner).</p>
  <p>What I am confused about is the environment here and how to implement this network. I was reading <a href="http://karpathy.github.io/2016/05/31/rl/" rel="nofollow noreferrer">this tutorial</a> and the author has used <a href="https://gym.openai.com/" rel="nofollow noreferrer">gym</a> library to set the environment.</p>
  <p>Should I build an environment from scratch myself or it is not always needed?</p>
  <p>I appreciate any help or hints or links to a source that helps me understand better RL concepts. I am new to it and easily gets confused.</p>
  
Tags: <reinforcement-learning><python><environment><gym>
Title: Should I build an environment from scratch myself or it is not always needed?
UserDisplayName: samsambakster
ThreadText: # Should I build an environment from scratch myself or it is not always needed?
  
  (Asked by: username_0 on 2020-06-28)
  
  I am inspired by the paper [Neural Architecture Search with Reinforcement Learning](https://arxiv.org/abs/1611.01578) to use reinforcement learning for optimizing a child network (learner). My meta-learner (controller or parent network) is an MLP and will take as the reward function a silhouette score. Its output is a vector of real numbers between 0 and 1. These values are k different possibilities for the number of clusters (the goal is to cluster the result of the child network which is an auto-encoder, embedded images are the input to the meta-learner).
  
  What I am confused about is the environment here and how to implement this network. I was reading [this tutorial](http://karpathy.github.io/2016/05/31/rl/) and the author has used [gym](https://gym.openai.com/) library to set the environment.
  
  Should I build an environment from scratch myself or it is not always needed?
  
  I appreciate any help or hints or links to a source that helps me understand better RL concepts. I am new to it and easily gets confused.
  
  **Tags:** reinforcement-learning, python, environment, gym
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-06-28. Score: 1
  
  I guess it would always be better if you can reuse existing environments to make it work for yourself. Since most of the environment codes is anyway [opensourced](https://github.com/openai/gym), you can always edit it to your liking.
  
  If you want a custom environment, you can add an environment to gym like [this](https://towardsdatascience.com/creating-a-custom-openai-gym-environment-for-stock-trading-be532be3910e).
  
  
  ---
  
  ### Answer by username_2 on 2023-08-14. Score: 1
  
  Gym environments were designed first of all as a *benchmark* for RL algorithms. Therefore, you should ask yourself: Do I want to benchmark my RL algorithm or do I want to solve my problem with RL?
  
  If the answer is "I want to benchmark my algorithm", you should probably go with existing environments. Using existing environments as benchmarks you will be able to compare your algorithm with other existing approaches.
  
  If the answer is "I want to solve my problem", then yes, perhaps the best way to continue is to build your custom environment.
  
  Finally, if you want to understand RL better, I would suggest to start with existing environments to gain a better grasp of RL concepts.
  
  
  ---
  
  