赞
踩
通常的 PyTorch Workflow 是这样的. But the workflow steps can be repeated and changed depending on the problem you’re working on.
Topic | Contents |
---|---|
Getting data ready | Data can be almost anything but to get started we’re going to create a simple straight line |
Build a model | Create a model to learn patterns in the data, and choose a loss function, optimizer and build a training loop |
Fitting the model to data (training) | Got the data and a model, now let’s the model (try to) find patterns in the (training) data. |
Making predictions and evaluating a model (inference) | The model’s found patterns in the data, let’s compare its findings to the actual (testing) data. |
Saving and loading a model | You may want to use your model elsewhere, or come back to it later |
Putting it all together | Let’s take all of the above and combine it. |
或者也可以是这几个步骤:
torch.utils.data.Dataset
和 torch.utils.data.DataLoader
torch.nn.Module
类来创建模型。torch.optim
模块来实现各种优化算法。torch.save()
和 torch.load()
函数来保存和加载模型。模型也可以通过TorchScript进行序列化,以便于在其他平台上进行部署。看到这了,给个赞呗~
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。