925fef58806a57b941c9d33c5628ac37af5b394d,models/pytorch/model.py,SIGGRAPHGenerator,forward,#SIGGRAPHGenerator#,134

Before Change


        // mask_B \in [0, +0.5]

        input_A = torch.Tensor(input_A).cuda()[None, :, :, :]
        input_B = torch.Tensor(input_B).cuda()[None, :, :, :]
        mask_B = torch.Tensor(mask_B).cuda()[None, :, :, :]

        conv1_2 = self.model1(torch.cat((input_A / 100., input_B / 110., mask_B - .5), dim=1))
        conv2_2 = self.model2(conv1_2[:, :, ::2, ::2])
        conv3_3 = self.model3(conv2_2[:, :, ::2, ::2])
        conv4_3 = self.model4(conv3_3[:, :, ::2, ::2])
        conv5_3 = self.model5(conv4_3)
        conv6_3 = self.model6(conv5_3)
        conv7_3 = self.model7(conv6_3)

        conv8_up = self.model8up(conv7_3) + self.model3short8(conv3_3)
        conv8_3 = self.model8(conv8_up)

        if(self.dist):
            out_cl = self.upsample4(self.softmax(self.model_class(conv8_3) * .2))

            conv9_up = self.model9up(conv8_3) + self.model2short9(conv2_2)
            conv9_3 = self.model9(conv9_up)
            conv10_up = self.model10up(conv9_3) + self.model1short10(conv1_2)
            conv10_2 = self.model10(conv10_up)
            out_reg = self.model_out(conv10_2) * 110

            return (out_reg * 110, out_cl)
        else:
            conv9_up = self.model9up(conv8_3) + self.model2short9(conv2_2)
            conv9_3 = self.model9(conv9_up)
            conv10_up = self.model10up(conv9_3) + self.model1short10(conv1_2)
            conv10_2 = self.model10(conv10_up)
            out_reg = self.model_out(conv10_2)
            return out_reg * 110

After Change


        // mask_B \in [0, +1.0]

        input_A = torch.Tensor(input_A)[None, :, :, :]
        input_B = torch.Tensor(input_B)[None, :, :, :]
        mask_B = torch.Tensor(mask_B)[None, :, :, :]
        mask_B = mask_B - maskcent
        
        // input_A = torch.Tensor(input_A).cuda()[None, :, :, :]
        // input_B = torch.Tensor(input_B).cuda()[None, :, :, :]
        // mask_B = torch.Tensor(mask_B).cuda()[None, :, :, :]

        conv1_2 = self.model1(torch.cat((input_A / 100., input_B / 110., mask_B), dim=1))
        conv2_2 = self.model2(conv1_2[:, :, ::2, ::2])
        conv3_3 = self.model3(conv2_2[:, :, ::2, ::2])
        conv4_3 = self.model4(conv3_3[:, :, ::2, ::2])
        conv5_3 = self.model5(conv4_3)
        conv6_3 = self.model6(conv5_3)
        conv7_3 = self.model7(conv6_3)

        conv8_up = self.model8up(conv7_3) + self.model3short8(conv3_3)
        conv8_3 = self.model8(conv8_up)

        if(self.dist):
            out_cl = self.upsample4(self.softmax(self.model_class(conv8_3) * .2))

            conv9_up = self.model9up(conv8_3) + self.model2short9(conv2_2)
            conv9_3 = self.model9(conv9_up)
            conv10_up = self.model10up(conv9_3) + self.model1short10(conv1_2)
            conv10_2 = self.model10(conv10_up)
            out_reg = self.model_out(conv10_2) * 110

            return (out_reg * 110, out_cl)
        else:
            conv9_up = self.model9up(conv8_3) + self.model2short9(conv2_2)
            conv9_3 = self.model9(conv9_up)
            conv10_up = self.model10up(conv9_3) + self.model1short10(conv1_2)
            conv10_2 = self.model10(conv10_up)
            out_reg = self.model_out(conv10_2)
            return out_reg * 110
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: junyanz/interactive-deep-colorization
Commit Name: 925fef58806a57b941c9d33c5628ac37af5b394d
Time: 2019-04-09
Author: rizhang@rizhangs-MacBook-Pro.local
File Name: models/pytorch/model.py
Class Name: SIGGRAPHGenerator
Method Name: forward