[JAX] Cholesky decomposition error 230318 기준
·
연구 Research/인공지능 Artificial Intelligent
현재 기준(230318)으로 cholesky decomposition을 사용할 때 행렬 크기가 50정도 넘어가면 nan을 출력하는 오류가 있다. jnp.linalg.cholesky(K) jax.random.multivariate_normal(subkeys[0], np.zeros((N_samples,)), K) 이 때문에 cholesky decomposition을 쓰는 다른 함수들도 영향을 받았는데 jax.random.multivariate_normal의 경우에도 랜덤하게 추출하는 과정에서 cholesky decomposition을 쓴다. cholesky decomposition은 어쩔 수 없을 것 같고 jax.random.multivariate_normal(subkeys[0], np.zeros((N_sa..
[JAX] JAX vmap에 대한 설명
·
연구 Research/인공지능 Artificial Intelligent
아직 jax가 한글화가 많이 안 되어있어서 기본적인 기능은 내가 적어놓으려고 한다. jax.vmap(fun, in_axes=0, out_axes=0, axis_name=None, axis_size=None, spmd_axis_name=None) function을 argument axes에 대해서 mapping해주는 기능. fun : mapping할 function in_axes : function에 들어가는 input을 의미한다. 정수, None, Python container(tuple/list/dict 모두 가능)을 지원한다. 이는 모두 mapping할 input array 축을 의미한다. 만약 fun의 argument가 array이면 in_axes에는 정수, None, 튜플(Integer, None..
[Dear Abby] 230314
·
영어 공부 English Study/글 Article
Coming-Out Creates Tension Between Longtime Friends - March 14, 2023 - DEAR ABBY: A dear friend, "Lorraine," contacted me because her daughter "Gabby" came out to her as bisexual and Lorraine knew I had experience with "this type of thing." My daughter is bisexual. Lorraine was repulsed by her daughter's revelation and upset that Gabby expected her to be supportive and wear pride stickers, etc. ..
[생산성] 코드 및 문서 비교할 때 유용한 툴
·
기타
위의 짤에서 알 수 있듯이 뭐하나 만들려고 하면 계속 수정해야하고 결국 옆에 'v1','v2'... 끝없이 버전이 늘어나거나 '최종', '진짜_최종'.. 계속 늘어난다. 이렇게 하는 거는 둘째치더라도 뭐가 바뀌었는지, 변경사항이 제대로 반영이 된 것인지 알 수 없을 때가 생겼다. 그래서 좀 편하게 변경사항을 확인하기 위한 방법을 여기서 소개한다. 1. 코드의 경우 코드는 깃(git)에서 관리하고 있다면 버전관리 측면에서 좀 더 편하게 수행할 수 있다. 그런데 꼭 깃을 쓰지 않더라도 코드 변경을 빨리 파악하고자 한다면 WinMerge라는 프로그램으로 코드 두개를 나란히 두고 비교해볼 수 있다. https://winmerge.org/ 에서 다운로드 가능하다. 2. 문서의 경우 2-1) pdf의 경우 논문 최..
[LaTeX] 여러 줄 주석처리
·
기타/논문작성 Writing
LaTeX는 주석처리를 하려면 주석처리하고 싶은 줄을 드래그하고 CTRL+/ 단축키를 통해 %를 추가하여 주석으로 만들 수 있다. 그런데 긴 줄의 코드를 주석처리하고 싶으면 이런 방식이 어려울 것이다. 이 글에서는 여러 줄을 한 보이게 하는 방법에 대해 다룬다. 1. 패키지 comment 또는 verbatim을 통해 comment 블록 생성 내가 찾아본 방법으로 가장 간단한 것은 \usepackage{verbatim} \begin{comment} % 주석처리할 내용 \end{comment} 다음과 같이 주석내용을 comment 블럭으로 감싸주는 것이다. package verbatim도 필요하니 같이 넣어준다. 그런데 verbatim의 경우 문제가 발생할 수도 있다고 한다. 따라서 \usepackage{c..
[LaTeX] Table 만들기
·
기타/논문작성 Writing
latex에서 table을 만드는 것이 일반 파워포인트나 워드, 한글에 비해 난이도가 있어서 다들 table generator를 많이 쓰는데 이렇게 만들어서 export했을 때 본인이 원하는 대로 수정하려면 어느정도 원리를 이해할 필요가 있다. 그리고 개인적으로는 export할 때 너무 코드가 난잡해서 불편할 때가 많았다. 그래서 정리하는 표 만들기 방법. 참고* 행과 열이 맨날 헷갈리는데, 보통 글을 쓸 때 '행간'을 얼마로 지정할지 정한다. 행은 즉, 각 줄의 사이 간격을 의미한다. 나는 이런 식으로 구별한다. 1. 기본 코드 구성 table을 만들 때는 위치와 정렬 및 구분자를 지정해야 한다. \begin{table}[hbt] # 위치 지정 \caption{캡션} \label{tab: 이름} \be..
[Dear abby] 230309
·
영어 공부 English Study/글 Article
Woman Reconsiders Pledge Made to Ailing Boyfriend - March 09, 2023 - DEAR ABBY: My boyfriend of four years has been diagnosed with chronic traumatic encephalopathy, or CTE. We're both only 51. Obviously, we face a grim reality. He has already tried once to end our relationship to spare me the inevitable, but I convinced him I'm in it to the bitter end. Now he's accusing his family (and me) of be..
[논문작성] Zotero에서 bibtex 내보낼 때 제목형식 바꾸는 방법
·
기타/논문작성 Writing
참고문헌을 bibtex로 export하는 과정에서 알게 된 내용을 적고자 한다. 문제상황 : 논문을 bibtex 파일로 export하는데 논문에서 요구하는 제목 형식은 2가지가 있다. Some citation styles, such as APA, require the use of sentence case for titles (e.g., “Oxidation and reduction of iron by acidophilic bacteria”). Others, like the Chicago Manual of Style, require title case (“Oxidation and Reduction of Iron by Acidophilic Bacteria”). 예를 들면 내가 인용하고 싶은 문헌의 제목이 Th..
[Dear abby] 230305
·
영어 공부 English Study/글 Article
Friend's Struggle With Diabetes Causes Concern DEAR ABBY: My best friend, who is 54, has had Type 1 diabetes since she was 9. She takes two insulin shots a day -- one in the morning and one in the evening. We live together, and at night her blood sugar drops pretty low. I can tell when it's happening because she becomes unresponsive. Twice she has had seizures that resulted in 911 calls. I have ..
[서지관리프로그램] ENDNOTE/Mendeley/Zotero
·
기타/논문작성 Writing
1. 서지관리프로그램이란? 대학원생이라면 접하는 구글 스칼라. 이 구글 스칼라에서 인용을 클릭하면 다음과 같은 화면을 볼 수 있다. BibTeX는 LaTeX에서 참고문헌을 추가할 때 쓰는 형식이다. 예를 들면 이런 것. @book{barro1997macroeconomics, title={Macroeconomics}, author={Barro, Robert J}, year={1997}, publisher={MIT Press} } EndNote는 endnote에 호환되는 파일이고 RefMan은 Mendeley에 호환되는 파일(ris파일인데 다른 서지 관리 프로그램 모두에게 적용 가능)이고 RefWorks는 RefWorks에 직접 export한다. 참고로 구글스칼라에서 export한 파일을 전적으로 신뢰하면 ..