首页 > 解决方案 > 如何在 pytorch 中连接模型?

问题描述

我做了2节课:

class Preprocess():
    def __init
     .....
    def forward 
     ....

class Model ():
    def __init
     .....
    def forward 

我想在将它们放入模型之前进行预处理。你能告诉我我怎样才能做到这一点吗?

标签: pythonmachine-learningpytorch

解决方案


只需编写它们:

pre = Preprocess()
model = Model()

output = model(pre(input))

推荐阅读