Giter VIP home page Giter VIP logo

Comments (8)

kchengiva avatar kchengiva commented on September 6, 2024 2

Thanks for your interest.
Firstly, the computation cost of temporal convolution is [(9 × T C1 C1) × N] instead of [(9 × T C C1) × N], which is 6.08G. My apologies for the typo in supplement. Our result is calculated by [(9 × T C1 C1) × N], which is consistent with the ST-GCN model structure.
Secondly, in the NTU RGB+D dataset, there are one or two people in each sample. For samples with only one person, the second person is padded with zeros. The skeleton graphs of these two people are computed respectively. So we need to multiply the computation cost by 2.
Thus the result is (2.0232G + 6.08G) * 2 = 16.2G.

from shift-gcn.

kchengiva avatar kchengiva commented on September 6, 2024 1

For ST-GCN, the number of parameters in a spatial convolution layer is [ C×C1 + C ], the number of parameters in a temporal convolution layer is [9×C1×C1 + C1], the number of parameters in FC layer is 256×60. The total parameter cost is 3.0M.
For Shift-GCN, the number of parameters in a spatial convolution layer is [C×C1 + C1 + N×C1], the number of parameters in a temporal convolution layer is [C1×C1 + C1 + 2C1], the number of parameters in FC layer is 256×60. The total parameter cost is 0.5M.

from shift-gcn.

vivek87799 avatar vivek87799 commented on September 6, 2024

Thank you very much for your quick response.
I have also verified for Shift-GCN.

Would also like to know if you have calculated the number of parameters for the model.

from shift-gcn.

vivek87799 avatar vivek87799 commented on September 6, 2024

Dear @kchengiva,

That was very helpful.

Thanks for your quick response.

from shift-gcn.

preksha12 avatar preksha12 commented on September 6, 2024

Dear @kchengiva,
In the given code I am not able to find where FLOPS are computed? Can you please help.

from shift-gcn.

kchengiva avatar kchengiva commented on September 6, 2024

Thanks for your interest. @preksha12
The code for calculating the computational cost of ST-GCN is as below:

import numpy as np 

channel = [[3,64],[64,64],[64,64],[64,64],[64,128],[128,128],[128,128],[128,256],[256,256],[256,256],]
temporal = [300,300,300,300,150,150,150,75,75,75]

# ST-GCN
Sflops = 0
Tflops = 0
for layer in range(len(channel)):
	Sflops += 3*(channel[layer][0]*channel[layer][1]*25 + channel[layer][1]*25*25)*temporal[layer]
	Tflops += 9*(temporal[layer]*25)*(channel[layer][1]*channel[layer][1])
fc = 256*60

print('ST-GCN')
print('spatial', Sflops*2/1e9)
print('temporal', Tflops*2/1e9)
print('1 stream', (Sflops+Tflops+fc)*2/1e9)
print('2 stream', (Sflops+Tflops+fc)/1e9*2*2)
print('4 stream', (Sflops+Tflops+fc)/1e9*2*4)

from shift-gcn.

preksha12 avatar preksha12 commented on September 6, 2024

Thanks for your interest. @preksha12
The code for calculating the computational cost of ST-GCN is as below:

import numpy as np 

channel = [[3,64],[64,64],[64,64],[64,64],[64,128],[128,128],[128,128],[128,256],[256,256],[256,256],]
temporal = [300,300,300,300,150,150,150,75,75,75]

# ST-GCN
Sflops = 0
Tflops = 0
for layer in range(len(channel)):
	Sflops += 3*(channel[layer][0]*channel[layer][1]*25 + channel[layer][1]*25*25)*temporal[layer]
	Tflops += 9*(temporal[layer]*25)*(channel[layer][1]*channel[layer][1])
fc = 256*60

print('ST-GCN')
print('spatial', Sflops*2/1e9)
print('temporal', Tflops*2/1e9)
print('1 stream', (Sflops+Tflops+fc)*2/1e9)
print('2 stream', (Sflops+Tflops+fc)/1e9*2*2)
print('4 stream', (Sflops+Tflops+fc)/1e9*2*4)

Thank you so much for your reply.

from shift-gcn.

preksha12 avatar preksha12 commented on September 6, 2024

Hello,
I also have doubt regarding how you have formulated these equations for FLOPS. How can we apply FLOPS formula for any other network?

Thanks for your interest. @preksha12
The code for calculating the computational cost of ST-GCN is as below:

import numpy as np 

channel = [[3,64],[64,64],[64,64],[64,64],[64,128],[128,128],[128,128],[128,256],[256,256],[256,256],]
temporal = [300,300,300,300,150,150,150,75,75,75]

# ST-GCN
Sflops = 0
Tflops = 0
for layer in range(len(channel)):
	Sflops += 3*(channel[layer][0]*channel[layer][1]*25 + channel[layer][1]*25*25)*temporal[layer]
	Tflops += 9*(temporal[layer]*25)*(channel[layer][1]*channel[layer][1])
fc = 256*60

print('ST-GCN')
print('spatial', Sflops*2/1e9)
print('temporal', Tflops*2/1e9)
print('1 stream', (Sflops+Tflops+fc)*2/1e9)
print('2 stream', (Sflops+Tflops+fc)/1e9*2*2)
print('4 stream', (Sflops+Tflops+fc)/1e9*2*4)

Thank you so much for your reply.

Hello,
I also have doubt regarding how you have formulated these equations for FLOPS. How can we apply FLOPS formula for any other network?

from shift-gcn.

Related Issues (20)

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.