CodingTrain / CodingTrain/Auto-Encoder-Demo

Refactorings

未关闭
#4 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
12
派生
14
PR 合并指标
30 天内没有已合并 PR

描述

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](https://github.com/CodingTrain/Auto-Encoder-Demo/pull/3/files#diff-3f564f5401f32a7d6e2f4cd89ac5e13c34f52518a3ea01435b844f3e73ba4e80), [Random](https://github.com/CodingTrain/Auto-Encoder-Demo/pull/3/files#diff-0be83b3e0a3f3593a840957dda9f5f4a6d73299c0ead498f495936cb043e00b9), and [Arbitrary Images](https://github.com/CodingTrain/Auto-Encoder-Demo/pull/3/files#diff-d1e391fdd5d710572f4958143f8bca131f71ba6b82feca4d844505f30b82a4be). 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](https://github.com/CodingTrain/Auto-Encoder-Demo/blob/d1369b08857136a734951e7909da7750ead5c7b4/model.js) 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](https://github.com/CodingTrain/Auto-Encoder-Demo/blob/d1369b08857136a734951e7909da7750ead5c7b4/ImageTransformer.js) 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 :) 🚂

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。