Skip to content

Refactorings #4

Open
Open
@TheCheif

Description

@TheCheif

Hi there :)

I wanted to make the code a bit more readable and organize everything in it's own class and file. I iopened pull request #3 for it.

I also added a DataSource class, which can provide training and testing data. I wanted to make an interface for it but yeah, JS does not have interfaces which is sad. The 3 sources i added are: Mnist, Random, and Arbitrary Images. The last one takes what ever is in the images folder, converts it an 28*28 greyscale images and uses it as test and training data.

I also expanded the NN by adding more layers to it. It is now divided into an encoder and decoder. It can also save it's state so you don't have to retrain it everytime.

The ImageTransformer takes an array of normalized pixel images and saves it to disk. It can also be used to save the encoded images from the NN (you just need to adjust the width and the height of the images which shall be saved to disk, e.g.: transformer.toImages(model.encode(testData, 'enc', 2, 16));)

The rest should be pretty much the same, just a bit more organized :) 🚂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions