8cc023c568f2cdcdf5c34c5fa1b76090073bca73,gluon/gluoncv2/models/resattnet.py,,_test,#,524
Before Change
assert (model != resattnet236 or weight_count == 103778984)
assert (model != resattnet452 or weight_count == 182285224)
x = Variable(torch.randn(1, 3, 224, 224))
y = net(x)
assert (tuple(y.size()) == (1, 1000))
After Change
net = model(pretrained=pretrained)
ctx = mx.cpu()
if not pretrained:
net.initialize(ctx=ctx)
// net.hybridize()
net_params = net.collect_params()
weight_count = 0
for param in net_params.values():
if (param.shape is None) or (not param._differentiable):
continue
weight_count += np.prod(param.shape)
print("m={}, {}".format(model.__name__, weight_count))
assert (model != resattnet56 or weight_count == 31810728)
assert (model != resattnet92 or weight_count == 52466344)
assert (model != resattnet128 or weight_count == 65294504)
assert (model != resattnet164 or weight_count == 78122664)
assert (model != resattnet200 or weight_count == 90950824)
assert (model != resattnet236 or weight_count == 103778984)
assert (model != resattnet452 or weight_count == 182285224)
x = mx.nd.zeros((1, 3, 224, 224), ctx=ctx)
y = net(x)
assert (y.shape == (1, 1000))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: osmr/imgclsmob
Commit Name: 8cc023c568f2cdcdf5c34c5fa1b76090073bca73
Time: 2018-12-04
Author: osemery@gmail.com
File Name: gluon/gluoncv2/models/resattnet.py
Class Name:
Method Name: _test
Project Name: kymatio/kymatio
Commit Name: 4f91cb1bfab978c05a30de8a70e36426aaa19df5
Time: 2018-11-21
Author: janden@flatironinstitute.org
File Name: examples/3d/compute_speed.py
Class Name:
Method Name:
Project Name: osmr/imgclsmob
Commit Name: a72a5b05d8edcde1e1bbb808ed26d5c858b112d5
Time: 2018-08-27
Author: osemery@gmail.com
File Name: gluon/models/dpn.py
Class Name:
Method Name: _test