From 8bd658bac51801faedf061843e56ba9d025e2012 Mon Sep 17 00:00:00 2001 From: Ethan Lew Date: Fri, 12 Apr 2024 18:42:05 -0400 Subject: [PATCH] remove casadi code --- notebooks/weighted-cost-func.ipynb | 63 ------------------------------ 1 file changed, 63 deletions(-) diff --git a/notebooks/weighted-cost-func.ipynb b/notebooks/weighted-cost-func.ipynb index 4c97847..897ed80 100644 --- a/notebooks/weighted-cost-func.ipynb +++ b/notebooks/weighted-cost-func.ipynb @@ -228,69 +228,6 @@ "plt.plot(trajectory_uw.states[:, 1], label='Trajectory Prediction')" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "bbe8ef2b-3169-476f-ad8c-003f92469247", - "metadata": {}, - "outputs": [], - "source": [ - "from casadi import *\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b656fb35-a5e0-4405-9564-332d427bfe47", - "metadata": {}, - "outputs": [], - "source": [ - "X = np.vstack([t.states[:-1] for t in training_data])\n", - "Xp = np.vstack([t.states[1:] for t in training_data])\n", - "W = [w[:-1] for w in weights]\n", - "g = experiment_results['tuned_model'].obs_func\n", - "gd = experiment_results['tuned_model'].obs.obs_grad\n", - "G = np.vstack([np.atleast_2d(g(x)).T for x in X])\n", - "Gp = np.vstack([np.atleast_2d(g(x)).T for x in Xp])\n", - "\n", - "G, Gd = G.T, Gp.T\n", - "Js = [gd(xi) for xi in X]\n", - "Wy = np.vstack(\n", - " [(np.abs(J) @ w.T).T \n", - " for J, w in zip(Js, W)\n", - " ])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "861fef48-3b9c-4686-ab7d-11183a80eff0", - "metadata": {}, - "outputs": [], - "source": [ - "(Js[0] @ W[0].T).shape" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ed116b64-098f-481b-bc5c-958b6a12c096", - "metadata": {}, - "outputs": [], - "source": [ - "Wy.T * G" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "51ac108b-7e59-4248-adf0-4c0042dac586", - "metadata": {}, - "outputs": [], - "source": [ - "J.shape" - ] - }, { "cell_type": "code", "execution_count": null,