[코드] JAX-FEM 설명
·
연구 Research/최적화 Optimization
2023년에 배포된 라이브러리인 JAX-FEM에서 Sensitivity analysis를 어떻게 하는지 설명하고자 한다. 참고문헌 :Xue, T. et al. JAX-FEM: A differentiable GPU-accelerated 3D finite element solver for automatic inverse design and mechanistic data science. Computer Physics Communications 291, 108802 (2023). Inverse design 문제를 푸는 것은 주로 topology optimization (TO)이라고도 표현하는데, 이 때 목적함수에 대한 gradient 값을 계산해야한다. 일반적으로 TO 문제는 Adjoint method를 통해..
[인공지능] Generative AI (1) Normalizing flows
·
연구 Research/인공지능 Artificial Intelligent
Generative modeling에서 GAN 이후로 다양한 모델이 나왔는데 현재도 그 모델 안에서 발전 중이다. 나름대로 흐름을 설명하면서 이야기하고 싶어서 조금씩 커버를 하고자 한다. 첫 번째 이야기는 Normalizing flows에 대한 이야기이다. 정확히 이게 뭔지를 알아야 나중에 discrete normalizing flows에서 continuous normalizing flows로 넘어가는 걸 이해할 수 있다. 사실 이전에 Variational autoencoder를 또 이해해야하는 문제인데 그건 나중에 작성해서 여기에 링크를 남길 예정이다. 흐름 normalizing flows (Ordinary differential equation model) (2016) - diffusion mode..
[논문] Nature format 정리
·
기타/논문작성 Writing
Nature materials format 기준으로 설명한다. : https://www.nature.com/nmat/submission-guidelines/aip-and-formatting자잘한 당연한 내용은 생략. 1. Document type- LaTeX 기준 article.cls, revtex.cls or amsart.cls와 같은 class file 사용- Computer Modern fonts를 사용할 것. Computer modern fonts : https://www.fontsquirrel.com/fonts/computer-modern- graphicx.sty 사용 - package graphicx를 import하면 됨.- number로만 인용할 것. manuscript 안에 referenc..
[Acoustics] Dispersion relation
·
기계공학 Mechanical engineering
기계진동학을 공부했지만 acoustics를 전혀 몰라서 작성하는 글. dispersion relation in acoustics는 wave frequency가 어떻게 wave number와 연관이 되어있느냐, 주파수에 따라 sound waves가 어떻게 빨리 전달되느냐에 대한 정보이다. 여기서 의문이었던 것은나는 항상 wave frequency = wave number라고 생각했기 때문이다. dispersion relation은$$\omega = \omega(k)$$다음과 같이 $\omega$는 angular frequency, $k$는 wave number이다. 이를 wave propagation behavior라고 한다. 이 관계에서phase velocity(speed of individual wa..
[PCA] Principal Component Analysis (PCA) example code
·
연구 Research/데이터과학 Data Science
Iris dataset (2d feature)로 PCA를 적용한 예시이다. import numpy as npfrom sklearn.decomposition import PCAfrom sklearn.preprocessing import StandardScalerfrom sklearn.datasets import load_iris# 1. Load sample data (Iris dataset)data = load_iris()X = data.data# 2. Standardize the data (Mean=0, Variance=1)scaler = StandardScaler()X_scaled = scaler.fit_transform(X)# 3. Apply PCA (reduce to 2 components)pca ..
[클로드코드] Claude.code 자료 모음
·
프로그래밍 Programming
최근에 AI를 활용한 코딩을 어떻게 할 것인가에 대한 논의가 많다.vscode 내에서도 copilot을 이용할 수 있고, CURSOR라는 소프트웨어도 IDE와 AI를 통한 코드 작성을 합친 편한 기능을 제공했다. Cursor의 등장 후에OpenAI (chatGPT)에서는 CODEX를 출시하고 구글(Gemini)에서는 Google antigravity를 출시했다. 둘 다 코드 편집을 위한 IDE와 AI를 같이 쓸 수 있는 프로그램이다. 나는 이미 Cursor를 쓰고 있었고 꽤 만족하고 있었다.둘 다 테스트를 해봐야겠다고 생각하던 와중에 클로드 코드가 좋다는 얘기를 들었다. 클로드 코드는 터미널에서 코드를 편집할 수 있도록 한 프로그램으로, 현재 기준 pro 버전을 구독해야 쓸 수 있다. 보통은 ID..
[Graphics] Signed distance fields / functions (SDFs)
·
카테고리 없음
Signed distance fields (SDFs) / Signed distance functions 특정 점의 position을 입력으로 받으면 그 shape에서 가장 가까운 점으로부터의 거리를 알려주는 함수다.이러한 함수는 Finite element method에서처럼 explicit하게 어떤 위치에 어떤 점이 있는지를 나타내는 것이 아니기 때문에 implicit curves or surfaces라고 표현하기도 한다. https://numfactory.upc.edu/web/Geometria/signedDistances.html Signed Distance Function (SDF): Implicit curves or surfacesSigned Distance Function (SDF): Impli..
[추정] Maximum likelihood estimator (MLE), Maximum a posterior Estimator(MAP)
·
카테고리 없음
Estimation에 대해 알기 전에 읽어두면 도움이 되는 글 : https://normal-engineer.tistory.com/191 Estimation을 공부하다보면 무조건 나오는 것이 Maximum Likelihood Estimator와 Maximum A-Posterior Estimator다.이 두 개 개념을 정확히 해놓으면 나중에 칼만 필터와 같은 이론을 공부할 때도 매우 도움이 된다.추정 이론을 공부하려면 수학과의 probability & statistics 내용을 기본적으로 알고 있어야 한다. 0. Estimation for what? 추정론을 할 때 가장 기본적인 생각은 "무엇"을 추정하고자 하는지 명확하게 해야한다는 것이다. 대부분은 데이터가 있고, 그 데이터를 예측하기 위한 모델의..
[JAX] JAX 최신버전(0.8.0~0.9.0) GPU 체크
·
프로그래밍 Programming
본인의 컴퓨터나 노트북에 NVIDIA GPU가 있고 CUDA가 이미 설치되어있는 것을 전제로 한다.또한 가상환경을 conda에서 만들어서 그 안에서 최신 버전의 JAX를 설치하는 과정이다. (일반적으로 JAX를 pip으로 설치하면 무조건 최신버전을 설치하도록 된다.) 설치한 JAX 버전은 현재 기준으로 가장 최신인 0.9.0이다. 이전 버전을 설치하고 싶다면 다음 글이 더 유용하다. 나는 주로 Linux x86_64, Windows WSL2 환경을 사용한다. 다음 커맨드를 실행하면 JAX GPU 버전이 설치가 되는데 여기서 가정하는 것은 CUDA가 적절하게 설치되어있다는 것이다.pip install --upgrade "jax[cuda12]" 최근에는 JAX installation 문서가 잘 업데이트..
[논문] 일러스트레이터에서 LaTeX 사용하는 법
·
기타/논문작성 Writing
일러스트레이터에서 작업하는데 평소에 쓰는 powerpoint나 draw.io와 달리 LaTeX를 사용할 수 없다는 것을 깨달았다.그래서 powerpoint에서 LaTeX를 플러그인으로 사용했던 것처럼 비슷한 방법을 찾아보았다. 1. LaTeX2AI다음 플러그인은 illustrator에서 latex을 쓸 수 있도록 만든 플러그인이다. https://github.com/isteinbrecher/LaTeX2AI GitHub - isteinbrecher/LaTeX2AI: LaTeX Plugin for Adobe IllustratorLaTeX Plugin for Adobe Illustrator. Contribute to isteinbrecher/LaTeX2AI development by creating an a..