jrender icon indicating copy to clipboard operation
jrender copied to clipboard

问一下demo2-deform的前向代码的含义

Open ojipadeson opened this issue 2 years ago • 0 comments

请问一下下面这段代码是什么意思。为什么要做一系列变换和定义center和displace变量。

    def execute(self, batch_size):
        base = jt.log(self.vertices.abs() / (1 - self.vertices.abs()))
        centroid = jt.tanh(self.center)
        vertices = (base + self.displace).sigmoid() * nn.sign(self.vertices)
        vertices = nn.relu(vertices) * (1 - centroid) - nn.relu(-vertices) * (centroid + 1)
        vertices = vertices + centroid

ojipadeson avatar Dec 09 '23 05:12 ojipadeson