ConvNetJS CIFAR-10 demo 卷积神经网络分类demo

本演示使用纯JavaScript在浏览器中训练卷积神经网络(ConvNet),无需安装额外软件。该网络针对CIFAR-10数据集进行训练,采用数据增强技术和AdaDelta自适应学习率方法。演示提供了网络结构和训练过程的详细视图。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ConvNetJS CIFAR-10 demo

Description

This demo trains a Convolutional Neural Network on the CIFAR-10 dataset in your browser, with nothing but Javascript. The state of the art on this dataset is about 90% accuracy and human performance is at about 94% (not perfect as the dataset can be a bit ambiguous). I used this python script to parse the original files (python version) into batches of images that can be easily loaded into page DOM with img tags.

This dataset is more difficult and it takes longer to train a network. Data augmentation includes random flipping and random image shifts by up to 2px horizontally and verically.

By default, in this demo we're using Adadelta which is one of per-parameter adaptive step size methods, so we don't have to worry about changing learning rates or momentum over time. However, I still included the text fields for changing these if you'd like to play around with SGD+Momentum trainer.

Report questions/bugs/suggestions to @karpathy.

Training Stats

Forward time per example: 23ms
Backprop time per example: 24ms
Classification loss: 2.24887
L2 Weight decay loss: 0.00085
Training accuracy: 0.16
Validation accuracy: -1
Examples seen: 141
Learning rate:     
Momentum:     
Batch size:     
Weight decay:   


 

Loss:

Instantiate a Network and Trainer


Network Visualization

Activations:
input (32x32x3)
max activation: 0.42549, min: -0.5
max gradient: 0.01467, min: -0.01771
Activations:
Activation Gradients:
Weights:

Weight Gradients:
conv (32x32x16)
filter size 5x5x3, stride 1
max activation: 1.13915, min: -0.9202
max gradient: 0.0151, min: -0.01904
parameters: 16x5x5x3+16 = 1216
Activations:
Activation Gradients:
relu (32x32x16)
max activation: 1.13915, min: 0
max gradient: 0.01867, min: -0.01904
Activations:
Activation Gradients:
pool (16x16x16)
pooling size 2x2, stride 2
max activation: 1.13915, min: 0
max gradient: 0.01867, min: -0.01904
Activations:
Activation Gradients:
Weights:
()()()()()()()()()()()()()()()()()()()()
Weight Gradients:
()()()()()()()()()()()()()()()()()()()()
conv (16x16x20)
filter size 5x5x16, stride 1
max activation: 0.74686, min: -1.94339
max gradient: 0.05836, min: -0.05125
parameters: 20x5x5x16+20 = 8020
Activations:
Activation Gradients:
relu (16x16x20)
max activation: 0.74686, min: 0
max gradient: 0.0788, min: -0.06547
Activations:
Activation Gradients:
pool (8x8x20)
pooling size 2x2, stride 2
max activation: 0.74686, min: 0
max gradient: 0.0788, min: -0.06547
Activations:
Activation Gradients:
Weights:
()()()()()()()()()()()()()()()()()()()()
Weight Gradients:
()()()()()()()()()()()()()()()()()()()()
conv (8x8x20)
filter size 5x5x20, stride 1
max activation: 0.46723, min: -0.37553
max gradient: 0.11546, min: -0.15106
parameters: 20x5x5x20+20 = 10020
Activations:
Activation Gradients:
relu (8x8x20)
max activation: 0.46723, min: 0
max gradient: 0.11546, min: -0.15106
Activations:
Activation Gradients:
pool (4x4x20)
pooling size 2x2, stride 2
max activation: 0.46723, min: 0
max gradient: 0.11546, min: -0.15106
Activations:
Activation Gradients:
fc (1x1x10)
max activation: 0.42779, min: -0.56877
max gradient: 0.11617, min: -0.82716
parameters: 10x320+10 = 3210
Activations:
softmax (1x1x10)
max activation: 0.17284, min: 0.0638
max gradient: 0, min: 0

Example predictions on Test set

test accuracy based on last 200 test images: 0
/from: http://cs.stanford.edu/people/karpathy/convnetjs/demo/cifar10.html/
car
cat
frog
airplane
truck
car
car
cat
frog
car
cat
airplane


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值