diff --git a/ddopnew/experiment_functions.py b/ddopnew/experiment_functions.py index 272fb99..bab5ff0 100644 --- a/ddopnew/experiment_functions.py +++ b/ddopnew/experiment_functions.py @@ -50,9 +50,6 @@ def __init__( self.criteria = criteria self.direction = direction - print("warmup", warmup) - print("patience", patience) - def add_result(self, J: float, # Return (discounted rewards) of the last epoch R: float, # Total rewards of the last epoch @@ -337,6 +334,7 @@ def run_experiment( agent: BaseAgent, stop = False if stop: + log_info(R, J, n_epochs-epoch-1, tracking, "val") logging.info(f"Early stopping after {epoch+1} epochs") break @@ -393,6 +391,7 @@ def run_experiment( agent: BaseAgent, stop = False if stop: + log_info(R, J, n_epochs-epoch-1, tracking, "val") logging.info(f"Early stopping after {epoch+1} epochs") break diff --git a/nbs/30_experiment_functions/10_experiment_functions.ipynb b/nbs/30_experiment_functions/10_experiment_functions.ipynb index 8a00c31..9a7878e 100644 --- a/nbs/30_experiment_functions/10_experiment_functions.ipynb +++ b/nbs/30_experiment_functions/10_experiment_functions.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -57,7 +57,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -122,7 +122,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -174,7 +174,7 @@ "| direction | str | max | Whether reward shall be maximized or minimized |" ] }, - "execution_count": 5, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -185,7 +185,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -225,7 +225,7 @@ "| **Returns** | **bool** | |" ] }, - "execution_count": 6, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -245,7 +245,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -341,7 +341,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -521,6 +521,7 @@ " stop = False\n", "\n", " if stop:\n", + " log_info(R, J, n_epochs-epoch-1, tracking, \"val\")\n", " logging.info(f\"Early stopping after {epoch+1} epochs\")\n", " break\n", " \n", @@ -577,6 +578,7 @@ " stop = False\n", "\n", " if stop:\n", + " log_info(R, J, n_epochs-epoch-1, tracking, \"val\")\n", " logging.info(f\"Early stopping after {epoch+1} epochs\")\n", " break\n", " \n", @@ -598,7 +600,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -672,7 +674,7 @@ "| eval_step_info | bool | False | |" ] }, - "execution_count": 9, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -713,7 +715,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -761,7 +763,7 @@ "| eval_step_info | bool | False | |" ] }, - "execution_count": 10, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -772,7 +774,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -820,7 +822,7 @@ "| eval_step_info | bool | False | Print step info during evaluation |" ] }, - "execution_count": 11, + "execution_count": null, "metadata": {}, "output_type": "execute_result" } @@ -838,7 +840,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -882,7 +884,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ diff --git a/nbs/30_experiment_functions/20_meta_experiment_functions.ipynb b/nbs/30_experiment_functions/20_meta_experiment_functions.ipynb index 8d213f3..d20255e 100644 --- a/nbs/30_experiment_functions/20_meta_experiment_functions.ipynb +++ b/nbs/30_experiment_functions/20_meta_experiment_functions.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -30,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -151,7 +151,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -259,7 +259,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -284,7 +284,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -312,7 +312,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -356,7 +356,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -389,7 +389,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -406,7 +406,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -441,18 +441,6 @@ "display_name": "python3", "language": "python", "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.0" } }, "nbformat": 4,