karpathy / convnetjs

Deep Learning in Javascript. Train Convolutional Neural Networks (or ordinary ones) in your browser.
MIT License
10.9k stars 2.04k forks source link

Upgrade TypeScript, CI config and support Layer type inference. #119

Closed Losses closed 3 years ago

Losses commented 3 years ago

Say, we have a net, and do following operation:

const layer = net.layers[0];
if (layer.layer_type === 'conv') {
  layer
}

In previous version, layer will always be ILayer, but TypeScript could automatically inference it from its typing.

With this pull request, the type of layer will become ConvLayer, which is more detailed.

Losses commented 3 years ago

Oh, shit... sorry, wrong repo...