GithubHelp home page GithubHelp logo

hw6's Introduction

Hw6

Summary:

Dataset Loading:

MNIST dataset loaded. Pixel values normalized to the range [0, 1]. Model Architectures:

Four models created with different architectures: Model 1: 1 hidden layer with tanh activation. Model 2: 1 hidden layer with sigmoid activation. Model 3: 2 hidden layers with tanh activation. Model 4: 2 hidden layers with sigmoid activation. Training:

Models compiled with categorical crossentropy loss and Adam optimizer. Trained for 20 epochs. Loss and accuracy curves plotted for training and validation sets. Evaluation:

Models evaluated on the test data. Test loss and accuracy printed. Additional Step:

Pixel Normalization: Pixel values of the images in the MNIST dataset are normalized to the range [0, 1] by dividing by 255. This code provides a comprehensive analysis of different neural network architectures and activation functions on the MNIST dataset, including normalization of pixel values to enhance training performance. The training and validation curves are visualized, and test accuracy is reported for each model.

Dataset Loading:

MNIST dataset is loaded, and class labels are converted to binary class matrices. Model Architectures:

Four models are created with different architectures: Model 1: 1 hidden layer with tanh activation Model 2: 1 hidden layer with sigmoid activation Model 3: 2 hidden layers with tanh activation Model 4: 2 hidden layers with sigmoid activation Training:

Each model is compiled using categorical crossentropy loss and the Adam optimizer. Training is performed for 20 epochs, and loss and accuracy curves are plotted for both training and validation sets. Evaluation:

The models are evaluated on the test data, and the test loss and accuracy are printed. This code provides a comparative analysis of different neural network architectures and activation functions on the MNIST dataset. It visually presents the training and validation curves for each model and reports the test accuracy after training.

hw6's People

Contributors

shinysaka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.