Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decomposition - symmetric and anti-symmetric #62

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions everything_else/reproducing.m
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,14 @@
%% Pg. 55, SCM-BCR
%% Pg. 56, Decomposition into symmetric and anti-symmetric parts

b = dec2bin(2^4-1:-1:0)-'0';
b1 = b(:,1); b2 = b(:,2); b3 = b(:,3); b4 = b(:,4);

f=b1.*b2 + b2.*b3 + b3.*b4 - 4*b1.*b2.*b3;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if this example had the following:

  • 1 linear term with a coefficient of +1,
  • 1 quadratic terms with a coefficient of +2,
  • 1 cubic term with a coefficient of -4, and
  • one quartic term with a coefficient of +2.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add that asap.

f_sym = (1/2)*(f + f.');
f_anti = (1/2)*(f - f.');

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes no sense. I don't see why you did f.'.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to make the transpose of the matrix.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ndattani my alternative solution is below. I will add that to the code if you approve.

% f_sym = (1/2)(f(b) + (1-f(b))
f_sym = (1/2)
(f + (1-f))

% f_anti = (1/2)(f(b) - (1-f(b))
f_anti = (1/2)
(f - (1-f))

Copy link
Member

@ndattani ndattani Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyone who has used MATLAB for as long as me would know that f.' does the transpose of f, but what made you think that it would be a good idea to do the transpose?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into how decomposition into symmetric and antisymmetric would be and I see there are 2 ways to do it. One this by adding and subtracting transpose into f, divided by two. Source: https://www.mathworks.com/matlabcentral/answers/401295-how-to-find-the-symmetric-and-skew-symmetric-part-of-a-specified-matrix.

The other is from the paper attached to the part in the book: https://www.maths.lth.se/matematiklth/vision/publdb/reports/pdf/kahl-strandmark-iccv-11.pdf. Notation: f - (1-transpose of f), divided by 2.

Can you please explain the difference between those 2? Thank you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second example doesn't use the transpose.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like I confused myself somewhere, my apologies. I will fix that tomorrow since I currently have to prepare to move.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
QUANTUM GADGETS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down