#2442: Fix config file path to be OS independent.

This commit is contained in:
Nick Todd
2024-05-02 16:16:36 +01:00
parent 2774442561
commit a37ed4e487

View File

@@ -21,24 +21,14 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Import packages and read config file." "Set up training data."
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Set up training data." "Import packages and read config file."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import multiprocessing as mp\n",
"mp.get_all_start_methods()"
] ]
}, },
{ {
@@ -61,12 +51,17 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"\n", "from primaite.config.load import data_manipulation_config_path"
"EPISODE_LEN = 128\n", ]
"NUM_EPISODES = 10\n", },
"NO_STEPS = EPISODE_LEN * NUM_EPISODES\n", {
"BATCH_SIZE = 32\n", "cell_type": "code",
"LEARNING_RATE = 3e-4\n" "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with open(data_manipulation_config_path(), 'r') as f:\n",
" cfg = yaml.safe_load(f)"
] ]
}, },
{ {
@@ -76,8 +71,11 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"\n", "\n",
"with open(\"c:/projects/primaite/src/primaite/config/_package_data/data_manipulation.yaml\", \"r\") as f:\n", "EPISODE_LEN = 128\n",
" cfg = yaml.safe_load(f)\n" "NUM_EPISODES = 10\n",
"NO_STEPS = EPISODE_LEN * NUM_EPISODES\n",
"BATCH_SIZE = 32\n",
"LEARNING_RATE = 3e-4\n"
] ]
}, },
{ {
@@ -116,11 +114,8 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"\n", "n_procs = 2\n",
"\n", "train_env = SubprocVecEnv([make_env(i + n_procs) for i in range(n_procs)])\n"
"n_procs = 4\n",
"train_env = SubprocVecEnv([make_env(i + n_procs) for i in range(n_procs)])\n",
"print(train_env)\n"
] ]
} }
], ],
@@ -140,7 +135,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.11" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,