Skip to content

Basic of Autoencoder, Principal Component Analysis(PCA), and Neural Network

Notifications You must be signed in to change notification settings

jinhoishere/autoencoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assignment3

This is Assignment 3 by Jinho Nam for CS 4850 (Foundation of AI) course.

How to set up the environment

The dependencies for this project are listed in requirements.txt. Python virtual environment will install all of the items within the file.

  1. Clone this repository.
  2. Navigate to the cloned project directory.
  3. Create a Python virtual environment.
    • python -m venv .venv
  4. Activate the virtual environment.
    • For Linux, source ./.venv/bin/activate
    • For Windows, .\.venv\Scripts\activate\
  5. Install dependencies
    • pip install -r requirements.txt

How to get result from the code

This is the instruction what code to run to get the answers for questions in PDF file. If the Python virtual environment and the dependencies are installed succesfully, this instruction will give the result as supposed.

  • Question 1

    • simpleAutoencoder.py and Q1.py are the corresponding files for the answers.
    • For the 2-D plot, refer to the lines 32 and 33 in Q1.py. Once following the instruction from those lines, run Q1.py.
    • For the 3-D plot, refer to the lines 106 and 107 in Q1.py. Once following the instruction from those lines, run Q1.py.
    • Example output (2-D plots): question1-result(2-D)
    • Example output (3-D plots): question1-result(3-D)

      The output plots are also at here as .png file.

  • Question 2

    • simpleAutoencoder.py and Q2.py are corresponding files for the answers.
    • To see the result of model 1 with layers d → 50 → 2 → 50 → d, refer to lines 23-25 and 58-61 in simpleAutoencoder.py, and run Q2.py.
    • To see the result of model 2 with layers d → 100 → 50 → 2 → 50 → 100 → d, refer to lines 28 and 32 and 64-69 in simpleAutoencoder.py, and run Q2.py.
    • To see the result of model 3 with layers d → 200 → 100 → 50 → 2 → 50 → 100 → 200 → d, refer to lines 35-41 and lines 72-79, and run Q2.py
    • Example output (model 1): Q2_model-1
    • Example output (model 2): Q2_model-2
    • Example output (model 3): Q2_model-3

      "All of the above accuracies are calculated based on the true test-label dataset and the predicted test-label dataset."

  • Question 3

    • simpleANNClassifierPyTorch.py, utilityDBN.py and Q3.py are corresponding files for the answers.
    • To see the result, simply run Q3.py
    • Example output: Q3_decreasing-graph

      "The error rate of the graph starts increasing after the certain number of neurons(320). This means that the model overfitts at the training data beyond the certain point."

About

Basic of Autoencoder, Principal Component Analysis(PCA), and Neural Network

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages