Code Monkey home page Code Monkey logo

Comments (4)

LXN711 avatar LXN711 commented on July 24, 2024

I also have this doubt. I cannot find the expression of the relevant formula in the code, only unshared individually connection layer.If you understand this problem, can you discuss it with me?

from gla-gcn.

LazyLiunian avatar LazyLiunian commented on July 24, 2024

https://github.com/bruceyo/GLA-GCN/blob/master/common/s_agcn.py
I mischaracterized the problem earlier, I only found the shared individually layer, in s_agcn.py.
I consider self.fc in this module to be the shared individually layer.

class S_AGCN(TemporalModelBase):

      def __init__(self, num_joints_in, in_features, num_joints_out,
                   filter_widths, causal=False, dropout=0.25, channels=96, dataset='h36m'):
  
          super().__init__(num_joints_in, in_features, num_joints_out, filter_widths, causal, dropout, channels, dataset)
  
          layers_tcngcn = []
          num_person = 1
          in_channels = 2
          num_point = num_joints_in
          self.graph = Graph(dataset)
          self.data_bn = nn.BatchNorm1d(num_person * in_channels * num_point)
          A = self.graph.A
          self.expand_gcn = TCN_GCN_unit(2, channels, A)
  
          self.causal_shift = []
          next_dilation = filter_widths[0]
          for i in range(0, len(filter_widths)):
              self.pad.append((filter_widths[i] - 1)*next_dilation // 2)
              self.causal_shift.append((filter_widths[i]//2 * next_dilation) if causal else 0)
              layers_tcngcn.append(TCN_GCN_unit(channels, channels, A))
              layers_tcngcn.append(TCN_GCN_unit(channels, channels, A, stride=filter_widths[i], residual=False))
              next_dilation = next_dilation * filter_widths[i]
  
          self.layers_tcngcn = nn.ModuleList(layers_tcngcn)
          self.fc = nn.Conv1d(channels, 3, 1)
  
      def set_bn_momentum(self, momentum):
          self.data_bn.momentum = momentum
          self.expand_gcn.gcn1.bn.momentum = momentum
          self.expand_gcn.tcn1.bn.momentum = momentum
          for layer in self.layers_tcngcn:
              layer.gcn1.bn.momentum = momentum
              layer.tcn1.bn.momentum = momentum
  
      def _forward_blocks(self, x):
  
          N, V, T = x.size()
          v = torch.div(V, 2, rounding_mode='floor') # number of 2D pose joints
          x = self.data_bn(x)
          x = x.view(N, 1, v, 2, T)
          x = x.permute(0, 1, 3, 4, 2).contiguous()
          x = x.view(N, 2, T, v)
  
          x = self.expand_gcn(x)
          for i in range( len(self.pad) -1):
              res = x[:, :, self.causal_shift[i] + self.filter_widths[i]//2 :: self.filter_widths[i], :]
  
              x = self.drop(self.layers_tcngcn[2*i](x))
              x = self.drop(self.layers_tcngcn[2*i+1](x))
              x = res + x
          pose_3d_ = x
  
          pose_3d = torch.zeros(N, 3, v).cuda(0)
          for i in range(0,v):
              pose_joint_3d = pose_3d_[:,:,:,i].mean(2)
              pose_joint_3d = pose_joint_3d.view(N, -1, 1)
              pose_joint_3d = self.fc(pose_joint_3d)
              pose_3d[:,:,i] = pose_joint_3d.view(N,-1)
  
          return pose_3d

I also have this doubt. I cannot find the expression of the relevant formula in the code, only unshared individually connection layer.If you understand this problem, can you discuss it with me?

from gla-gcn.

LXN711 avatar LXN711 commented on July 24, 2024

Thank you for your reply. Perhaps you are right. That self.fc is a shared connection layer, because I have only looked at this code and haven't run it yet. and study it carefully. My question is that the description and code implementation of the individual connection layers in the paper do not seem to correspond. I am troubled by this issue.Do you have this question?

from gla-gcn.

LazyLiunian avatar LazyLiunian commented on July 24, 2024

Thank you for your reply. Perhaps you are right. That self.fc is a shared connection layer, because I have only looked at this code and haven't run it yet. and study it carefully. My question is that the description and code implementation of the individual connection layers in the paper do not seem to correspond. I am troubled by this issue.Do you have this question?

Yes๏ผŒI also have this issue.

from gla-gcn.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.