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

[2주차] DAC 코드 리뷰 #6

Open
seyongk opened this issue Apr 23, 2022 · 4 comments
Open

[2주차] DAC 코드 리뷰 #6

seyongk opened this issue Apr 23, 2022 · 4 comments
Assignees

Comments

@seyongk
Copy link
Collaborator

seyongk commented Apr 23, 2022

코드 링크를 공유 드립니다.

r 값을 None으로 처리하는 부분에 대해서 혹시 좋은 아이디어 있으시면 알려주시면 감사하겠습니다~!

구현 중인 코드

https://github.com/rest1h/self-supervised-learning-narratives-1/tree/main/week1_DAC

저자분 코드

https://github.com/vector-1127/DAC

참고한 깃헙

https://github.com/JiaxinZhuang/DAC.Pytorch
https://github.com/graykode/DAC
https://github.com/GuHongyang/DAC-pytorch/blob/master/main.py

유튜브 링크

https://youtu.be/Yp9GgiBKzts

@sooahleex
Copy link
Collaborator

저자 코드에서 Ybatch = (np.sign(np.dot(Y,Y.T)-th)+1)/2 부분이 혹시 논문에서 어느 부분에 해당하는지 알려주실 수 있으실까요?

@seyongk
Copy link
Collaborator Author

seyongk commented Apr 23, 2022

저자 코드에서 Ybatch = (np.sign(np.dot(Y,Y.T)-th)+1)/2 부분이 혹시 논문에서 어느 부분에 해당하는지 알려주실 수 있으실까요?

논문에 sine 함수 사용에 대해서 직접적으로 언급하는 부분은 없는 것 같아요.
제 생각에는 해당 코드 부분이 하는 역할은 코사인 유사도 값을 threshold 기준에 따라서 label feature를 구하는 부분인 것 같습니다.
데이터셋 별로 label feature를 구하는 방식이 다양해서 저도 많이 궁금했는데요, 저자분께 여쭤볼게요.

@jwkanggist
Copy link
Owner

제 생각에도 이부분은 th값에 따라서 clustering assignment를 하는 과정이라고 봅니다.

    1. np.sign(np.dot(Y,Y.T)-th):
      - th 보다 크면 1 th보다 작으면 -1이 나올것이고
    1. ((1) 의 결과 )+1)/2 : sign()을 결과를 binary로 맵핑하는 과정으로 보이네요
      - 1 --> 1 , -1 -->0

@sooahleex

@sooahleex
Copy link
Collaborator

@rest1h @jwkanggist 이해 했습니다! 두 분 모두 답변 감사드립니다 :)

@jwkanggist jwkanggist changed the title [2주차] DAC 코드 링크 [2주차] DAC 코드 리뷰 Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants