- 博客(10)
- 资源 (9)
- 收藏
- 关注
原创 pytorch-obtain feature maps from network
1.import torch import torch.nn as nnimport torchvision.models as modelsfrom torch.autograd import Variableimport timeclass toyNet(nn.Module): def __init__(self, pretrained_model, layers
2017-05-29 21:04:35 1640
原创 pytorch-fineturn the network and adjust learning rate
1. ignored_params = list(map(id, model.fc.parameters()))base_params = filter(lambda p: id(p) not in ignored_params, model.parameters())optimizer = torch.optim.SGD([ {'params': base_params},...
2017-05-29 20:09:56 1804
原创 pytorch-save and load models
1.torch.save(model_name.static_dict(), name_to_save)net = ModelClass(args)net.load_static_dict(torch.load(PATH))2.torch.save(model, PATH)net = torch.load(PATH)
2017-05-29 17:12:34 5615
原创 pytorch-parameter initialization
torch.nn.initweight.data.fill_(1)bias.data.fill_(0)weight.data.uniform_(-stdv, stdv)1. params = list(net.parameters())2. conv2params = list(net.conv2.parameters())kernels conv2params[0]bias conv2para...
2017-05-29 16:53:18 5286
原创 pytorch-class nn.Module
1. .children()return a generator objectlen(list(net.children()))nn.Sequential(*list(net.children())[:10])where. net is an object of Model2. register_backward_hook()
2017-05-29 16:18:36 3491
原创 Linux-Download tools
1. wget wget -O new_name.zip urlwget urlwget -b wget -c 2. axel axel -an 4 url---------------------------------reference-----------------1. http://blog.csdn.net
2017-05-28 22:20:59 806
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人