Skip to content

Commit

Permalink
try to use eigenpooling as the global pooling mechanism
Browse files Browse the repository at this point in the history
Signed-off-by: Anant Thazhemadam <[email protected]>
  • Loading branch information
thazhemadam committed Oct 12, 2021
1 parent bb512f3 commit cad8cc0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/layers/pool/eigenpool.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ struct EigenPool
end
end

function eigen_pooling(graph::Matrix{<:Real}, features::Matrix{<:Real})
L = Atoms.normalized_laplacian(graph) # get the laplacian matrix
# here, L is the laplacian matrix
# this probably needs to be optimized.
function eigen_pooling(L::Matrix{<:Real}, features::Matrix{<:Real})
L_eigen_vectors = eigvecs(L) # find eigen vectors for L
result = Vector()

Expand All @@ -33,7 +34,8 @@ function eigen_pooling(graph::Matrix{<:Real}, features::Matrix{<:Real})
end

# using an agreeable H and then return H elements of result hcatt-ed into a single 1xdH vector

result = hcat(result...)'
reshape(result, length(result), 1) # return it as a dHx1 Matrix
end

#=
Expand Down

0 comments on commit cad8cc0

Please sign in to comment.