2017-11-16 21 views

답변

0

(this file에서 찾을 수있다)를 env.seed() 함수의 문서화 문자열은 함수가 어떻게 구현해야하는지에 다음과 같은 문서를 제공합니다

Sets the seed for this env's random number generator(s). 

    Note: 
     Some environments use multiple pseudorandom number generators. 
     We want to capture all such seeds used in order to ensure that 
     there aren't accidental correlations between multiple generators. 
    Returns: 
     list<bigint>: Returns the list of seeds used in this env's random 
      number generators. The first value in the list should be the 
      "main" seed, or the value which a reproducer should pass to 
      'seed'. Often, the main seed equals the provided 'seed', but 
      this won't be true if seed=None, for example. 

주를, 그 무엇과 달리 문서 및 코멘트에 당신이 연결 한 문제는, 내게는 env.seed() 같은 사용자 환경에 의해 무시되는 것 같지 않습니다. env.seed()은 매우 간단한 구현을 가지고 있습니다. 반환 값은 env._seed()이고, 반환 값은 입니다.은 사용자 지정 환경에서 재정의해야하는 함수입니다.

예를 들어, OpenAI 체육관의 atari environments은 (C++ 기반) 아케이드 학습 환경에서 내부적으로 사용되는 시드를 설정하는 사용자 정의 _seed() 구현을 가지고 있습니다. 당신이 your custom environment에서 random.random() 전화를 가지고 있기 때문에

, 당신은 아마 random.seed() 전화를 _seed()을 구현해야합니다. 그렇게하면 환경의 사용자는 동일한 인수로 환경에 seed()을 호출하여 실험을 재현 할 수 있습니다.

참고 :는 객체 환경이 초기화됩니다 전용 임의의 객체, 씨앗을 만들기 위해 더 나은, 그리고 항상 랜덤를 얻을 수 있는지 확인 할 수 있습니다,하지만 예기치 될 수있다이 같은 글로벌 임의 씨와 장난 해당 개체의 환경에서 필요하면 번호를 입력하십시오.

0

최근 merge에서 OpenAI gym 개발자는 의 동작을 더 이상 env._seed() 메서드를 호출하지 않도록 변경했습니다. 대신 메서드는 이제 경고를 내고 반환합니다. 이 메서드를 사용하여 환경의 시드를 설정하려면 지금 바로 덮어 써야합니다.