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 摘要。