Openai-gym : Setting is_slippery=False in FrozenLake-v0 - openai-gym

In openai-gym, I want to make FrozenLake-v0 work as deterministic problem. So, I need to set variable is_slippery=False.
How can I set it to False while initializing the environment?
Reference to variable in official code

All you have to do is to pass the is_slippery=False argument when creating the environment:
import gym
env = gym.make('FrozenLake-v0', is_slippery=False)

Related

How to override attribute of a BERT class

I am using BertJapaneseTokenizer for an NLP project.
I am running into the error "The unidic_lite dictionary is not installed". On checking under the hood it looks from one of the elif conditions that this error will be thrown only if the variable mecab_dic is set = "unidic_lite" (please see this link https://huggingface.co/transformers/v4.11.3/_modules/transformers/models/bert_japanese/tokenization_bert_japanese.html)
Furthermore, due to some unavoidable constraints I cannot install unidic_lite module (let's just assume this is a constraint I have). However, I can install unidic. So my question is -- is there a way to do a manual override like mecab_dic = "unidic" such that elif statement for unidic_lite is bypassed altogether?
(relatedly, we can see from the constructor of MecabTokenizer that mecab_dic should have default value as "ipadic", then why is it set as mecab_dic set = 'unidic_lite' anyway!?)
Any suggestion would be super helpful. Thanks!
(P.S: I am not super tech-savvy so this was attempt at a crude workaround)
What I tried: downloaded the tokenization_bert_japanese.py code to my local machine and created a static variable mecab_dic = "unidic" in it and tried to import BertJapanesTokenizer from this customized python script instead of the standard "from transformers import BertJapaneseTokenzier"

Is there a way to specify a environment variable and define a value for each environment in gitlab UI?

I would like to create an environment variable like DB_URL and them define a different value for dev, test and production. I couldn't find a way to do it using gitlab UI.
EDIT: I know how to create a variable and how to define an environment for it. The point is that I need the same variable (same name) with a different value for each environment. I can define only one pair (environment, value) per variable. I would like to define many.
PS: I'm using gitlab coummunity edition.

Can the config crate merge environment variables into a subsection of a hierarchical config file?

I am using the Config crate in Rust, and would like to use environment variables to set keys inside a section of the config. The end goal is to override application settings from a docker compose file, or docker command line, using the environment.
If my config was the following, could I use a specifically crafted environment variable to set database.echo ?
(code blurb below is taken from this example)
debug = true
[database]
echo = true
The example code to configure this using the environment variables illustrates only to set keys at the top level. Wondering how to extend this. The .set() takes a hierarchical key, so I'm hopeful that there's a way to encode the path in the env variable name.
Answering my own question.
I just noticed that the Environment code accepts a custom separator which will get replaced with . (dot).
So one can set the separator to something like _XX_ and that would get mapped to a ".". Setting DATABASE_XX_ECHO=true, for instance would then change the database.echo key.

Unable to change model parameter in the classic_control environments in OpenAI gym

I am working with the CartPole-v1 environment and I am trying to change some of the model parameters (such as force_mag) in order to test the robustness of my algorithms w.r.t model variations. I am trying to do so with the following code:
env = gym.make('myCartPole-v1)
env.force_mag = -10.0 # nominal is +10.0
but I do not see any change in the model behavior, while testing it with my learnt policy (which should fail/worsen, but it does not). Nothing happens when changing other parameters (e.g.
masscart, length...). Am I missing something? What is the best way to produce local changes to the models?
The problem was solved by creating an instance of the environment and by calling env.unwrapped. The code in the example should look like: env = gym.make('myCartPole-v1).unwrapped

How to permanently set the environment variables for OpenVino

I am setting up OpenVino on my system and I get this form the documentation:
(Optional): OpenVINO toolkit environment variables are removed when you close the Command Prompt window. As an option, you can permanently set the environment variables manually.
But there is no information is available on what are the required environment variables and what value they should be set.
I need to know the list of environmental variable needed by OpenVino and the value that they should be set to. I know how to set them in Windows (using GUI or Setx).
The environment variables need to be set are given in the setupvars.bat file present at "path_to_computer_vision_sdk_directory\bin".
But I will give a general idea on the paths that need to be set -
Set the following System variables in your Environment Variables
Variable name: INTEL_CVSDK_DIR
Variable value: path_to_computer_vision_sdk_directory i.e.
C:\Intel\computer_vision_sdk_version_number, in case you have the cvsdk setup at the default path for installation
Variable name: OpenCV_DIR
Variable value: %INTEL_CVSDK_DIR%\opencv\cmake
Variable name: OPENVX_FOLDER
Variable value: %INTEL_CVSDK_DIR%\openvx
Variable name: InferenceEngine_DIR
Variable value: %INTEL_CVSDK_DIR%\deployment_tools\inference_engine\share
Variable name: HDDL_INSTALL_DIR
Variable value: %INTEL_CVSDK_DIR%\deployment_tools\inference_engine\external\hddl
Now edit the "Path" variable under System Variables to include the following values -
%INTEL_CVSDK_DIR%\opencv\x64\vc14\bin
%INTEL_CVSDK_DIR%\openvx\bin
%INTEL_CVSDK_DIR%\deployment_tools\inference_engine\bin\intel64\Release
%INTEL_CVSDK_DIR%\deployment_tools\inference_engine\bin\intel64\Debug
%HDDL_INSTALL_DIR%\bin
You also nee to set the "PYTHONPATH" to %INTEL_CVSDK_DIR%\python\python_version%

Resources