All problems
GIN Sum vs Mean Check
Problem
Check whether sum pooling and mean pooling can distinguish two bags of node features.
features_a and features_b are lists of numbers representing each graph's node features. Return [s, m] where s is 1 when the sums differ and m is 1 when the means differ, else 0.
Hint
A graph neural network with mean readout cannot tell apart equal-size bags with equal means.
Test cases
case 1
in: [[1,2],[3]]
expected: [0,1]
case 2
in: [[1,2],[1,2]]
expected: [0,0]
case 3
in: [[1],[2]]
expected: [1,1]
case 4
in: [[],[]]
expected: [0,0]
Starter codePython
def gin_sum_vs_mean_check(features_a, features_b):
# Your code here
pass4 test cases · run your code against them in the editor