From 01755deefe1da203863e8575f6f9156fb9aaf062 Mon Sep 17 00:00:00 2001 From: udlbook <110402648+udlbook@users.noreply.github.com> Date: Thu, 27 Nov 2025 16:16:07 -0500 Subject: [PATCH] Created using Colab --- .../ShallowNN/LinearRegions_Answers.ipynb | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/notebooks/ShallowNN/LinearRegions_Answers.ipynb b/notebooks/ShallowNN/LinearRegions_Answers.ipynb index 732cdba..f00e2b0 100644 --- a/notebooks/ShallowNN/LinearRegions_Answers.ipynb +++ b/notebooks/ShallowNN/LinearRegions_Answers.ipynb @@ -4,7 +4,7 @@ "metadata": { "colab": { "provenance": [], - "authorship_tag": "ABX9TyNzwsksM8IfDPg9DEiV++cL", + "authorship_tag": "ABX9TyORO/RUktvUyRPd9NT1GOoz", "include_colab_link": true }, "kernelspec": { @@ -87,15 +87,10 @@ "outputs": [], "source": [ "def number_regions(Di, D):\n", - " # TODO -- implement Zaslavsky's formula\n", - " # Tou can use math.comb() https://www.w3schools.com/python/ref_math_comb.asp\n", - " # Replace this code\n", - " N = 1;\n", - " # BEGIN_ANSWER\n", + "\n", " N= 0\n", " for j in range (Di+1):\n", " N = N+ math.comb(D, j)\n", - " # END_ANSWER\n", "\n", " return N" ] @@ -306,18 +301,14 @@ "# First let's write a function that computes the number of parameters as a function of the input dimension and number of hidden units (assuming just one output)\n", "\n", "def number_parameters(D_i, D):\n", - " # TODO -- replace this code with the proper calculation\n", - " N = 1\n", - " # BEGIN_ANSWER\n", - " N = D_i * D +D + D + 1\n", - " # END_ANSWER\n", + " N = D_i * D + D + D + 1\n", "\n", " return N ;" ], "metadata": { "id": "Pav1OsCnpm6P" }, - "execution_count": 22, + "execution_count": 25, "outputs": [] }, { @@ -332,9 +323,9 @@ "base_uri": "https://localhost:8080/" }, "id": "VbhDmZ1gwkQj", - "outputId": "76de7c87-699a-46ce-d3ff-265000a0ff6c" + "outputId": "d03fe328-1c27-43bf-95f4-5dc01e5e5656" }, - "execution_count": 23, + "execution_count": 26, "outputs": [ { "output_type": "stream", @@ -382,9 +373,9 @@ "height": 541 }, "id": "AH4nA50Au8-a", - "outputId": "533d25e5-68fb-4cad-f605-e6e98f06d79b" + "outputId": "55555d33-f75e-45ef-e197-d48a3c9066d9" }, - "execution_count": 24, + "execution_count": 27, "outputs": [ { "output_type": "stream", @@ -408,6 +399,15 @@ "metadata": {} } ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "daA1dAPsLD0h" + }, + "execution_count": null, + "outputs": [] } ] } \ No newline at end of file