Thanks to visit codestin.com
Credit goes to github.com

Skip to content

maxvol adjustment #586

@dontempty

Description

@dontempty

Is your feature request related to a problem? Please describe.

I think there might be an issue with the maxvol function. https://github.com/tensorly/tensorly/blob/main/tensorly/contrib/decomposition/_tt_cross.py
You referred to "The Greedy approximation algorithm for MAX-VOL" in the paper "Ali Çivril, Malik Magdon-Ismail: On selecting a maximum volume sub-matrix of a matrix and related problems."

In that paper, they mention "Remove the projection of v from every element of A." When I read this part, I interpreted it as calculating an orthogonal vector to the vector 𝑣 with the largest norm.
However, in your code, it doesn't seem to calculate the orthogonal vector. Instead, it uses something that looks strange to me.

Maybe I am misunderstanding your code or the paper.
Could you clarify whether I am wrong or if there is indeed an issue with the code?

Describe alternatives you've considered

image
This is your code

#Find the row of max norm"
max_row_idx = np.argmax(rows_norms, axis=0)
max_row = A[rest_row_idx[max_row_idx], :]

projection = np.dot(A_new, max_row.T)
projection = projection / np.sum(max_row**2)
        
#calculate orthogonal vector"
A_new = A_new - np.outer(projection, max_row)

This is my code

Additional context

When I compared the performance between my code and yours, here are the results:
image

  • The blue line represents my code, while the orange line represents your code.
  • You can see that the volume achieved by my code is almost always larger than yours.
  • Occasionally, your code outperforms mine, but this happens in only 11% of the iterations.

The values on the graph were calculated using a randomly generated matrix.

Could you clarify the cause of this discrepancy? Is there an issue with the logic in your code, or is it something I might be missing?
Let me know if this works!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions