{"id":20619941,"url":"https://github.com/mafda/deep_learning_101","last_synced_at":"2025-06-13T12:34:30.326Z","repository":{"id":81393529,"uuid":"132494305","full_name":"mafda/deep_learning_101","owner":"mafda","description":"Introduction to the basic notions that involve the concept of Machine Learning and Deep Learning. Linear Regression, Logistic Regression, Artificial Neural Networks, Deep Neural Networks, Convolutional Neural Networks.","archived":false,"fork":false,"pushed_at":"2023-10-19T03:55:25.000Z","size":3827,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-03T05:37:24.429Z","etag":null,"topics":["artificial-neural-networks","cnn-keras","conda-environment","convolutional-neural-networks","deep-learning","deep-neural-networks","keras","linear-regression","logistic-regression","machine-learning","mnist","neural-network","python","tensorflow"],"latest_commit_sha":null,"homepage":"https://mafda.medium.com/ml-dl-machine-learning-and-deep-learning-101-2686d93d70d","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mafda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-07T17:28:04.000Z","updated_at":"2024-03-22T06:20:26.000Z","dependencies_parsed_at":"2024-11-20T11:00:49.686Z","dependency_job_id":"457e866b-8723-4186-b52e-75087034aa04","html_url":"https://github.com/mafda/deep_learning_101","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mafda/deep_learning_101","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafda%2Fdeep_learning_101","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafda%2Fdeep_learning_101/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafda%2Fdeep_learning_101/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafda%2Fdeep_learning_101/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mafda","download_url":"https://codeload.github.com/mafda/deep_learning_101/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafda%2Fdeep_learning_101/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259645445,"owners_count":22889607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-neural-networks","cnn-keras","conda-environment","convolutional-neural-networks","deep-learning","deep-neural-networks","keras","linear-regression","logistic-regression","machine-learning","mnist","neural-network","python","tensorflow"],"created_at":"2024-11-16T12:12:57.866Z","updated_at":"2025-06-13T12:34:30.300Z","avatar_url":"https://github.com/mafda.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deep Learning 101\n\nThis repository presents the **basic notions** that involve the concept of\nMachine Learning and Deep Learning.\n\nRead more in this post [ML \u0026 DL — Machine Learning and Deep Learning\n101](https://medium.com/@mafda_/ml-dl-machine-learning-and-deep-learning-101-2686d93d70d).\n\n## Configure environment\n\n- Create the conda environment\n\n```shell\n(base)$: conda env create -f environment.yml\n```\n\n\u003e Mac OS users could use the `environment_ios.yml` file for configuring the iOS\n\u003e development environment.\n\n- Activate the environment\n\n```shell\n(base)$: conda activate deep_learning_101\n```\n\n- Run!\n\n```shell\n(deep_learning_101)$: python -m jupyter notebook\n```\n\n## Models\n\nThe models include a brief theoretical introduction and practical\nimplementations developed using Python and Keras/TensorFlow in Jupyter\nNotebooks.\n\n### Development Environment:\n\nThe development environment that will be used as one of the primary frameworks\nfor machine learning and deep learning, alongside Python programming, is the\nJupyter Notebook environment.\n\n![keras flow](src/img/keras-flow.png)\n\n#### 1. Load Data\n\nLoad data (training and testing set):\n\n```python\nimport tensorflow as tf\n\nX_train, y_train = tf.keras.datasets.mnist.load_data()\nX_test, y_test = tf.keras.datasets.mnist.load_data()\n```\n\n#### 2. Define Model\n\nTwo models:\n[Sequential](https://keras.io/getting-started/sequential-model-guide/) and\n[Functional API](https://keras.io/getting-started/functional-api-guide/).\n\nSequential used to stack layers:\n* `model.add()` used to add the layers.\n* `input_shape =()` specify the input form.\n\n```python\nmodel = tf.keras.models.Sequential()\nmodel.add(layer1 …, input_shape=(nFeatures))\nmodel.add(layer2 … )\n```\n\n#### 3. Compile Model\n\nConfigure the learning process by specifying:\n\n* [`optimizer`](https://keras.io/optimizers) which determines how weights are\n  updated,\n* [Cost function](https://keras.io/losses) or `loss` function,\n* [`metrics`](https://keras.io/metrics) to evaluate during training and testing.\n\n```python\nmodel.compile(optimizer='SGD', loss='mse', metrics=['accuracy'])\n```\n\n#### 4. Fit Model\n\nStart the training process.\n\n* `batch_size`: divide the data set into a number of batches.\n* `epochs`: number of times the data set is trained completely.\n\n```python\nmodel.fit(X_train, y_train, batch_size=500, epochs=1)\n```\n\n#### 5. Evaluate Model\n\nEvaluate the performance of the model.\n\n* `model.evaluate()` finds the specified loss and metrics, and it provides a\n  **quantitative** measure of accuracy.\n* `model.predict()` finds the output for the provided test data and it is useful\n  to check the outputs **qualitatively**.\n\n```python\nhistory = model.evaluate(X_test, y_test)\ny_pred = model.predict(X_test)\n```\n\n* [ML \u0026 DL — Development environment (Part 1)](https://mafda.medium.com/ml-dl-development-environment-part-1-5bb0b35750aa)\n\n### Accuracy results\n\n|  Model |  Architecture |         Activation | Parameters | Accuracy |\n| -----: | ------------: | -----------------: | ---------: | -------: |\n| LogReg |            -- |                 -- |       7850 |   0.9282 |\n|    ANN |          [32] |          [sigmoid] |      25450 |   0.9636 |\n|    DNN |     [128, 64] |       [relu, relu] |      25450 |   0.9801 |\n|    CNN | [32, 64, 128] | [relu, relu, relu] |      25450 |   0.9898 |\n\n### Target - Hypothesis - Cost\n\n|  Model |                  Target |                                            Hypothesis |               Cost |\n| -----: | ----------------------: | ----------------------------------------------------: | -----------------: |\n| LinReg |              Continuous |                                        $\\hat{y}=Wx+b$ |                MSE |\n| LogReg |             Categorical |                                $\\hat{y}=\\sigma(Wx+b)$ |      Cross-Entropy |\n|    ANN | Continuous, Categorical |                         $\\hat{y}=f_{(2)}(f_{(1)}(x))$ | MSE, Cross-entropy |\n|    DNN | Continuous, Categorical |             $\\hat{y}=f_{(n)}(...f_{(2)}(f_{(1)}(x)))$ | MSE, Cross-entropy |\n|    CNN | Continuous, Categorical | $\\hat{y}=f_{(n)}(...f_{(2)(\\ast)}(f_{(1)(\\ast)}(x)))$ | MSE, Cross-entropy |\n\n\n### Theoretical introduction (https://mafda.medium.com):\n\n* [ML \u0026 DL — Linear Regression (Part 2)](https://mafda.medium.com/ml-dl-linear-regression-part-2-14f114f2d62a)\n* [ML \u0026 DL — Logistic Regression (Part 3)](https://mafda.medium.com/ml-dl-logistic-regression-part-3-fe6aca8f01b)\n* [ML \u0026 DL — Artificial Neural Networks (Part 4)](https://mafda.medium.com/ml-dl-artificial-neural-networks-part-4-619350a93ef1)\n* [ML \u0026 DL — Deep Neural Networks (Part 5)](https://mafda.medium.com/ml-dl-deep-artificial-neural-networks-part-5-568ad05be712)\n* [ML \u0026 DL — Convolutional Neural Networks (Part 6)](https://mafda.medium.com/ml-dl-convolutional-neural-networks-part-6-97357db58165)\n\n### Practical implementations (Jupyter Notebooks):\n\n* [Linear Regression](https://github.com/mafda/deep_learning_101/blob/master/src/01-linear-regression.ipynb)\n* [Logistic Regression](https://github.com/mafda/deep_learning_101/blob/master/src/02-logistic-regression.ipynb)\n* [Artificial Neural Networks](https://github.com/mafda/deep_learning_101/blob/master/src/03-artificial-neural-networks.ipynb)\n* [Deep Neural Networks](https://github.com/mafda/deep_learning_101/blob/master/src/04-deep-neural-networks.ipynb)\n* [Convolutional Neural Networks](https://github.com/mafda/deep_learning_101/blob/master/src/05-convolutional-neural-networks.ipynb)\n  \n\n## [pt-BR] Presentation\n\n* [deep-learning-101.pdf](https://github.com/mafda/deep_learning_101/blob/master/pdf/deep-learning-101.pdf)\n\n## References\n\n* Complete Post Medium\n  * [ML \u0026 DL — Machine Learning and Deep Learning 101](https://mafda.medium.com/ml-dl-machine-learning-and-deep-learning-101-2686d93d70d)\n\n* Book\n  * [Deep Learning Book](http://www.deeplearningbook.org/)\n\n---\n\nmade with 💙 by [mafda](https://mafda.github.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmafda%2Fdeep_learning_101","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmafda%2Fdeep_learning_101","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmafda%2Fdeep_learning_101/lists"}