Skip to content

Instantly share code, notes, and snippets.

@suyash
Last active October 6, 2019 04:56

Revisions

  1. suyash revised this gist Oct 6, 2019. 1 changed file with 23 additions and 23 deletions.
    46 changes: 23 additions & 23 deletions mixture_density_nets_2d.ipynb
    Original file line number Diff line number Diff line change
    @@ -81,7 +81,7 @@
    "colab_type": "text"
    },
    "source": [
    "$$PDF = \\frac{1}{2\\pi\\sigma_x\\sigma_y\\sqrt{1 - \\rho^2}}exp(\\frac{-1}{2(1 - \\rho^2)}(\\frac{(x - \\mu_x)^2}{\\sigma_x^2} + \\frac{(y - \\mu_y)^2}{\\sigma_y^2} - \\frac{2\\rho(x - \\sigma_x)(y - \\sigma_y)}{\\sigma_x\\sigma_y}))$$"
    "$$PDF = \\frac{1}{2\\pi\\sigma_x\\sigma_y\\sqrt{1 - \\rho^2}}exp(\\frac{-1}{2(1 - \\rho^2)}(\\frac{(x - \\mu_x)^2}{\\sigma_x^2} + \\frac{(y - \\mu_y)^2}{\\sigma_y^2} - \\frac{2\\rho(x - \\mu_x)(y - \\mu_y)}{\\sigma_x\\sigma_y}))$$"
    ]
    },
    {
    @@ -162,7 +162,7 @@
    "plt.figure(figsize=(8, 8))\n",
    "plt.scatter(z, y, c=\"red\", alpha=0.3)"
    ],
    "execution_count": 5,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -205,7 +205,7 @@
    "plt.figure(figsize=(8, 8))\n",
    "plt.scatter(z, x, c=\"red\", alpha=0.3)"
    ],
    "execution_count": 6,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -252,7 +252,7 @@
    "ax.set_zlabel(\"y\")\n",
    "ax.scatter3D(z, x, y, c=\"red\", alpha=0.3)"
    ],
    "execution_count": 7,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -294,7 +294,7 @@
    "source": [
    "model = create_model()"
    ],
    "execution_count": 8,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "stream",
    @@ -339,7 +339,7 @@
    " verbose=0,\n",
    ")"
    ],
    "execution_count": 10,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "stream",
    @@ -366,7 +366,7 @@
    "source": [
    "plt.plot(hist.history[\"loss\"])"
    ],
    "execution_count": 11,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -536,7 +536,7 @@
    "ax.scatter(z, y, c=\"red\", alpha=1)\n",
    "ax.scatter(zz, yy, c=\"blue\", alpha=0.3)"
    ],
    "execution_count": 20,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -581,7 +581,7 @@
    "ax.scatter(z, x, c=\"red\", alpha=1)\n",
    "ax.scatter(zz, xx, c=\"blue\", alpha=0.3)"
    ],
    "execution_count": 21,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -629,7 +629,7 @@
    "ax.scatter3D(z, x, y, c=\"red\", alpha=1)\n",
    "ax.scatter3D(zz, xx, yy, c=\"blue\", alpha=0.3)"
    ],
    "execution_count": 22,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -698,7 +698,7 @@
    "plt.figure(figsize=(8, 8))\n",
    "plt.scatter(z, y, c=\"red\", alpha=0.3)"
    ],
    "execution_count": 24,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -741,7 +741,7 @@
    "plt.figure(figsize=(8, 8))\n",
    "plt.scatter(z, x, c=\"red\", alpha=0.3)"
    ],
    "execution_count": 25,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -788,7 +788,7 @@
    "ax.set_zlabel(\"y\")\n",
    "ax.scatter3D(z, x, y, c=\"red\", alpha=0.3)"
    ],
    "execution_count": 26,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -874,7 +874,7 @@
    "source": [
    "plt.plot(hist.history[\"loss\"])"
    ],
    "execution_count": 30,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -1032,19 +1032,19 @@
    "metadata": {
    "id": "i2v-f9obB40s",
    "colab_type": "code",
    "outputId": "1c160929-26f2-405a-eaea-de1d4654a781",
    "colab": {
    "base_uri": "https://localhost:8080/",
    "height": 503
    },
    "outputId": "1c160929-26f2-405a-eaea-de1d4654a781"
    }
    },
    "source": [
    "fig = plt.figure(figsize=(8, 8))\n",
    "ax = fig.add_subplot(\"111\")\n",
    "ax.scatter(z, y, c=\"red\", alpha=1)\n",
    "ax.scatter(zz, yy, c=\"blue\", alpha=0.3)"
    ],
    "execution_count": 39,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -1077,19 +1077,19 @@
    "metadata": {
    "id": "TbUateGaB67c",
    "colab_type": "code",
    "outputId": "c000a7fa-5f7f-4cd1-ba0b-c6c21485a0f2",
    "colab": {
    "base_uri": "https://localhost:8080/",
    "height": 503
    },
    "outputId": "c000a7fa-5f7f-4cd1-ba0b-c6c21485a0f2"
    }
    },
    "source": [
    "fig = plt.figure(figsize=(8, 8))\n",
    "ax = fig.add_subplot(\"111\")\n",
    "ax.scatter(z, x, c=\"red\", alpha=1)\n",
    "ax.scatter(zz, xx, c=\"blue\", alpha=0.3)"
    ],
    "execution_count": 40,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
    @@ -1122,11 +1122,11 @@
    "metadata": {
    "id": "lLn5uSU-CAjO",
    "colab_type": "code",
    "outputId": "6ed55de1-5e89-4ba9-baca-93eacfe24dea",
    "colab": {
    "base_uri": "https://localhost:8080/",
    "height": 483
    },
    "outputId": "6ed55de1-5e89-4ba9-baca-93eacfe24dea"
    }
    },
    "source": [
    "fig = plt.figure(figsize=(8, 8))\n",
    @@ -1137,7 +1137,7 @@
    "ax.scatter3D(z, x, y, c=\"red\", alpha=1)\n",
    "ax.scatter3D(zz, xx, yy, c=\"blue\", alpha=0.3)"
    ],
    "execution_count": 41,
    "execution_count": 0,
    "outputs": [
    {
    "output_type": "execute_result",
  2. suyash created this gist Oct 4, 2019.
    1,169 changes: 1,169 additions & 0 deletions mixture_density_nets_2d.ipynb
    1,169 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.