Skip to content

whydumb/Physical_AI_RL_IN_MINECRAFT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

279 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

강화학습# Physical AI RL IN Minecraft

마인크래프트를 통해 피지컬 AI 강화학습을 쉽게 접하고 즐길 수 있는 프로젝트입니다.

Overview

This project allows you to easily explore and enjoy Physical AI Reinforcement Learning through Minecraft. Experience how AI agents learn to interact with a physical environment in an accessible and fun way.

What?

Other companies train their robots using reinforcement learning with ultra-high-performance GPUs. I realized that approach isn't possible with just a laptop's 3060 GPU.

Simulators like Isaac Sim require direct training of robot joints, which is computationally heavy. However, VRM models already contain motion data from human-created bone structures, and this includes much more sophisticated 3-axis rotations than robot joint movements (URDF).

I'm building a lightweight conversion system that directly translates this data into single-axis motor movements. This way, robots can quickly replicate human motions without complex training, and it uses almost no GPU power.

If I can fully leverage VRM's vast motion dataset, I believe I can significantly improve real robot movement quality without reinforcement learning.

Overview

제시해주신 휴머노이드 팔(7자유도) 및 일반적인 가상 환경 수치를 적용할 경우, 이론적인 연산 및 샘플 효율성 개선 효과는 다음과 같습니다.

개선 요소 (Factor) 전통적 방식 (Legacy) VRM 시스템 (Ours) 개선 배율 (Speedup)
제어 연산
(IK vs FK)
$\Theta(k n^3)$ $\Theta(n)$ $250 \sim 500 \times$
충돌 감지
(Mesh vs Voxel)
$\Theta(N^2 V F)$ $\Theta(1)$ $10^7 \sim 10^8 \times$
총 학습 비용
(Two-Phase)
$\Theta(E T k n^3)$ $\Theta(E T n)$ $70 \sim 80 \times$
샘플 효율
(VRM Prior)
$O( \mathcal{S} )$

1. 연산 복잡도 개선 (Computational Speedup)

전통적인 RL 루프에서 가장 큰 병목은 **역기구학(IK)**과 메시 기반 충돌 감지입니다. 저희 시스템은 이 둘을 근본적으로 더 저렴한 연산으로 대체합니다.

1-1. IK $\to$ FK 대체: $O(n^3)$ 연산을 $O(n)$으로

로봇의 목표 위치(Task-space)에서 관절 각도(Joint-space)를 찾는 **역기구학(IK)**은 로봇의 자유도 $n$에 대해 야코비안 역행렬 계산 등 높은 비용을 요구합니다.

  • IK 기반 (전통): 한 스텝당 $\Theta(k n^3)$ (여기서 $k$는 반복 횟수)
  • FK 기반 (Ours): 관절 각도를 아는 상태에서 위치를 구하는 **정기구학(FK)**은 단순 행렬 곱으로 $\Theta(n)$

수치적 예시 (7자유도 로봇): $n=7$ 관절, $k=5 \sim 10$회 반복 시 속도비($S_{\text{step}}$)는 다음과 같습니다.

$$ S_{\text{step}} = \frac{\text{cost}_{\text{IK}}}{\text{cost}_{\text{FK}}} = \Theta(k n^2) \approx 250 \sim 500 \times $$

결론: IK를 FK로 대체함으로써, 한 스텝당 필요한 산술 연산량이 최소 250배 이상 감소합니다.

1-2. Mesh $\to$ Voxel 충돌 감지: $O(N^2VF)$$O(1)$

정교한 메시 기반 충돌 감지는 물체 수($N$)와 폴리곤 수($V, F$)에 따라 기하급수적으로 느려집니다.

  • 메시 기반 (전통): 모든 물체 쌍 검사 $\rightarrow \Theta(N^2 V F)$
  • Voxel 기반 (Ours): 로봇이 점유하는 고정된 공간(Constant $C$)만 해시 조회 $\rightarrow \Theta(1)$

수치적 예시 (일반적인 씬): $N=20, V \approx 5,000$일 때:

$$ R(N,V,F) = \frac{\Theta(N^2 V F)}{\Theta(1)} \approx 10^8 \quad (\text{1억 배}) $$

결론: 복잡한 씬에서도 충돌 감지 연산은 **상수 시간(Constant Time)**에 처리됩니다.


2. 총 학습 비용 효율화 (Amortized Cost)

저희는 2단계 학습(Two-Phase Training) 전략을 사용합니다.

  1. Offline: 데모 수집 시에만 IK 사용 ($K$ 에피소드)
  2. Online: RL 학습 시에는 FK만 사용 ($E$ 에피소드)

$$ C_{\text{two}} = \underbrace{\Theta(K T k n^3)}_{\text{Offline (Demo)}} + \underbrace{\Theta(E T n)}_{\text{Online (RL)}} $$

일반적으로 RL 학습량($E$)은 데모 양($K$)보다 훨씬 많습니다 ($E \gg K$). 손익분기점은 $E \approx 1.004 K$ 수준으로 매우 낮으며, 대규모 학습 시 효율은 극대화됩니다.

$$ \frac{C_{\text{trad}}}{C_{\text{two}}} \xrightarrow{E \to \infty} \Theta(k n^2) \approx 70 \sim 80 \times \text{ (Total Speedup)} $$

결론: 전체 학습 파이프라인에서 약 70~80배의 연산 비용 절감 효과를 얻습니다.


3. 샘플 효율성 개선 (Sample Efficiency via VRM Prior)

강화학습의 난이도는 탐색해야 할 상태 공간의 크기에 비례합니다. VRM Prior는 이 공간을 획기적으로 줄여줍니다.

  • 전통적인 RL ($\mathcal{S}$): 물리적으로 불가능하거나, 자가 충돌이 일어나거나, 부자연스러운 모든 상태를 탐색합니다.
  • VRM 기반 RL ($\mathcal{M}$): 인간의 움직임 데이터로 형성된 매니폴드(Manifold) 근처만 탐색합니다.

샘플 복잡도($N$)의 개선 비율은 전체 공간 대비 매니폴드의 비율에 비례합니다.

$$ \text{Sample Efficiency Gain} = \frac{N_{\text{base}}}{N_{\text{prior}}} = \Omega \left( \frac{|\mathcal{S}|}{|\mathcal{M}|} \right) $$

결론: 로봇이 불필요한 실패를 겪는 시행착오(Trial-and-Error) 과정을 생략하여, 수백 배에서 수만 배 더 적은 에피소드로도 학습이 가능합니다.


Summary

이 프로젝트는 **수학적 최적화(FK, Voxel)**와 **데이터 기반 최적화(VRM Prior)**를 결합하여 하드웨어 장벽을 낮췄습니다.

$$ \text{Total Optimization} = \underbrace{\Theta(k n^2)}_{\text{Algorithm}} \times \underbrace{\Theta(N^2 V F)}_{\text{Physics Engine}} \times \underbrace{\Omega(|\mathcal{S}|/|\mathcal{M}|)}_{\text{Data Prior}} $$

About

No description, website, or topics provided.

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages