Skip to content

[Feat] decoder multi-base 설계 반영 - state_vec 확장 및 return_logits 추가#9

Open
ohchanju3 wants to merge 3 commits into
mainfrom
feat/decoder
Open

[Feat] decoder multi-base 설계 반영 - state_vec 확장 및 return_logits 추가#9
ohchanju3 wants to merge 3 commits into
mainfrom
feat/decoder

Conversation

@ohchanju3
Copy link
Copy Markdown
Collaborator

@ohchanju3 ohchanju3 commented May 23, 2026

개요

multi-base 설계 반영 및 state 표현력 개선을 위해 decoder.py를 수정했습니다.


변경 내용

model/decoder.py

역할: 매 step마다 현재 state(query)와 encoded_flights(key)를 attention으로 비교해 다음 action 확률 반환

  1. state_vec 38 → 71차원으로 확장

    • airport_emb_dim + 6airport_emb_dim * 2 + 7
    • base_airport_emb(32) 추가: multi-base 설계에서 에피소드마다 base가 달라지므로 모델이 목표 base를 명시적으로 알아야 복귀 경로 계획 가능
    • rest_remaining 스칼라 추가: is_resting=True일 때 남은 rest 시간 정보 제공 (기존 is_resting 플래그만으로는 얼마나 남았는지 알 수 없음)
  2. return_logits 옵션 추가

    • REINFORCE log_prob 계산 시 torch.log(softmax(x))보다 F.log_softmax(x)가 수치적으로 안정적
    • return_logits=True면 softmax 전 raw score 반환 → 외부에서 F.log_softmax 적용

추후 확인 필요

  • train.py state_to_vec()에 rest_remaining 스칼라 추가 필요 (6개 → 7개, TODO 주석 남겨둠)
  • encoder.py의 airport_emb_dim과 decoder 값 일치해야 함

@ohchanju3 ohchanju3 requested a review from pkhyrn268 May 23, 2026 12:36
@ohchanju3 ohchanju3 self-assigned this May 23, 2026
@ohchanju3 ohchanju3 changed the title [Doc] Decoder - 파라미터 역할 및 state_vec 구성 주석 추가 [Feat] decoder multi-base 설계 반영 - state_vec 확장 및 return_logits 추가 May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant