묻고 답해요
167만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨강화학습 입문에서 Deep Q-learning/Policy Gradient까지
Deep Q-Learning algorithm에 대하여
Deep Q-Learning algorithm에 대하여target Q와 Q 학습 과정에서 Q값이 학습되면 행동도 target Q와 Q가 같아 지는게 잘 이해되지 않습니다. 처음에는 각각의 서로 다른 행동의 Q값들이 각각의 행동별 Target Q에 동시 학습되는 것으로 이해를 하였는데, 그런게 아닌거 같습니다.
-
해결됨유니티 머신러닝 에이전트 완전정복 (응용편)
닷지 ckpt 모델 파일을 onnx변환 후 unity에서 추론
안녕하세요. 닷지 ckpt 모델 파일을 onnx로 변환 후 unity에서 추론하는 방법에 대해 알려주실 수 있을까요? 제가 시도를 해보았을 때는 NullReferenceException이 나면서 정상 작동하지 않습니다. ml-agent learn에서 자동으로 출력되는 onnx파일들은 정상 작동이 되구요. 감사합니다.
-
미해결유니티 머신러닝 에이전트 완전정복 (기초편)
onnx에 대해서
MLAgent환경학습에 보면 학습이 끝나면 결과로onnx파일이 생성된다고 나와있는데DQN을 직접짜는 실습2에서도 맨마지막에 학습이 종료되면 onnx파일이 생성되는건가요? 제 경우엔 생성되지 않던데..1. 직접짜는 방식으로도 onnx는 생성되는게 맞는지2. 생성되지 않는다면 직접짜는 방식으로 어떻게 생성할수 있는지이 두가지가 궁금합니다.
-
미해결유니티 머신러닝 에이전트 완전정복 (기초편)
텐서플로우가 안열립니다
학습은 잘진행되는거같은데 이렇게 있는데 텐서보드에 가면 이렇게 뜨네요 어떻게 하죠?
-
미해결프로그래머를 위한 강화학습(저자 직강)
실습강의 소스코드
강의 잘 보고 있습니다.몇몇 프로그래밍 실습강의가 있는데, 거기서 사용된 소스코드는 공유가 안되는지요? 소스가 공유 된다면 유용할 것 같아요.
-
미해결강화학습 올인원: 기초, 최신 알고리즘, 실무 활용까지
소스코드 없어요
3-1 강화학습 기본 알고리즘-마르코프 결정과정 8. 마르코프 결정과정 상태 가치 함수 ---> 소스코드 없음
-
미해결유니티 머신러닝 에이전트 완전정복 (기초편)
DQN을 위한 파라메터값 세팅에서 goal-plus, goal-ex
state_size에서 [3, 64,84]면은 아 알쥐비하고 해상도를 이용해 스테이트사이즈를 세팅했구나를 알겠는데goal-plus하고goal-ex하고나뉘어져 있는 이유를 모르겠습니다.각각goal-plusgoal-ex는 어떤 의미의 집합인가요?
-
미해결강화학습 올인원: 기초, 최신 알고리즘, 실무 활용까지
강화학습, 머신러닝에 관심 있는 웹 개발자입니다. 수학적 난이도 때문에 실무 활용이 고민됩니다.
저는 현직 웹 개발자로, 강화학습 및 머신러닝에 평소 큰 관심이 있어서 관련 강의를 꾸준히 듣고 있습니다. 최근 강의들은 분량이 짧아 접근성은 좋은데, 수학적 표현(수식, 기호)이 등장할 때마다 의도를 즉각적으로 해석하지 못하고 혼란을 겪습니다.강의자 분께서는 '필요한 수학적 개념은 강의 중에 그때그때 이해하면 된다'고 안내하지만, 저에게는 수학적 진입장벽이 너무 높게 느껴지고, 결국 코드의 동작 방식만 어렴풋이 이해할 뿐 수학적 본질을 놓치게 되어 데이터 분석 분야 학습에 자꾸 실패감을 경험하고, 많은 관련 강의를 듣기를 실패한 경험들이 많습니다.실무 개발자로서 강화학습과 머신러닝을 업무에 적용하고 싶은데,수학적 배경이 깊지 않아도 어느 정도까지는 실무 적용 가능한 수준의 이해가 가능한지,수학적 난관을 만났을 때 어떤 접근법과 학습 전략이 효과적인지,제대로 이해하고 있다는 것을 확인할 수 있는 메타인지 방법이나 공부 전략은 무엇인지현실적이고 구체적인 조언을 부탁드립니다.
-
미해결프로그래머를 위한 강화학습(저자 직강)
환경구축에 대해서
anaconda에서는 환경구축 하기가 힘든가요? 제가 연구실 컴터가 conda 가상환경으로 환경구축이 되어있어서,,,python도 3.13.5쓰고 있는데 다 삭제하고 3.7.7설치하는 건 조금 부담이 되서 ㅜㅜ
-
미해결강화학습 입문에서 Deep Q-learning/Policy Gradient까지
Cartpole 환경 이해 및 시각화 관련 문의
[1]안녕하세요? 강화학습 입문 강의 듣고 있습니다. 순서적으로 듣고 있는데 환경이 Jupyter note에서 VS로 갑자가 바뀐 이유가 궁금합니다. [2]VS를 새로 설치해야하나요? 답변 부탁드립니다.2025.06.28from Olivetree
-
미해결강화학습 올인원: 기초, 최신 알고리즘, 실무 활용까지
실습 프로그램 파일 제공 문의
실습 스크립트 파일은 따로 제공되지 않나요?
-
미해결핸즈온 머신러닝 2
1판으로 들어도 크게 무리가 없을지요?
안녕하세요 지식 공유자님, 다름이 아니라 제가 제가 핸즈온 머신러닝 1판을 가지고있는데요, 혼자서 읽기엔 벅차서 집에 고이 모셔둔 상태로 몇년이 지났는데... 혹시 이 강의를 1판 책과 함께 들어도 진행하는데 크게 무리가 없을까요?
-
미해결유니티 머신러닝 에이전트 완전정복 (기초편)
dqn 인덱스 에러
dqn 학습 부분에서, index에러가 자꾸 납니다.. dqn.py는 github에 올려져 있는 것을 그대로 사용했습니다. < 에러 코드 >(colab) C:\Users\pss60\Desktop\ML-Agents_Project\agents>python dqn.py Traceback (most recent call last): File "C:\Users\pss60\Desktop\ML-Agents_Project\agents\dqn.py", line 218, in <module> state = preprocess(dec.obs[OBS], dec.obs[GOAL_OBS]) IndexError: list index out of range < GridAgent >using System; using UnityEngine; using System.Linq; using Unity.MLAgents; using Unity.MLAgents.Sensors; using Unity.MLAgents.Actuators; using UnityEngine.Rendering; using UnityEngine.Serialization; using System.Collections.Generic; public class GridAgent : Agent { [FormerlySerializedAs("m_Area")] [Header("Specific to GridWorld")] public GridArea area; public float timeBetweenDecisionsAtInference; float m_TimeSinceDecision; [Tooltip("Because we want an observation right before making a decision, we can force " + "a camera to render before making a decision. Place the agentCam here if using " + "RenderTexture as observations.")] public Camera renderCamera; VectorSensorComponent m_GoalSensor; private Transform agentTrans = null; private Vector3 moveRight = new Vector3(1, 0, 0); private Vector3 moveLeft = new Vector3(-1, 0, 0); private Vector3 moveUp = new Vector3(0, 0, 1); private Vector3 moveDown = new Vector3(0, 0, -1); public enum GridGoal { GreenPlus, RedEx, } // Visual representations of the agent. Both are blue on top, but different colors on the bottom - this // allows the user to see which corresponds to the current goal, but it's not visible to the camera. // Only one is active at a time. public GameObject GreenBottom; public GameObject RedBottom; GridGoal m_CurrentGoal; public GridGoal CurrentGoal { get { return m_CurrentGoal; } set { switch (value) { case GridGoal.GreenPlus: GreenBottom.SetActive(true); RedBottom.SetActive(false); break; case GridGoal.RedEx: GreenBottom.SetActive(false); RedBottom.SetActive(true); break; } m_CurrentGoal = value; } } [Tooltip("Selecting will turn on action masking. Note that a model trained with action " + "masking turned on may not behave optimally when action masking is turned off.")] public bool maskActions = true; const int k_NoAction = 0; // do nothing! const int k_Up = 1; const int k_Down = 2; const int k_Left = 3; const int k_Right = 4; EnvironmentParameters m_ResetParams; public override void Initialize() { m_GoalSensor = this.GetComponent<VectorSensorComponent>(); m_ResetParams = Academy.Instance.EnvironmentParameters; } public override void CollectObservations(VectorSensor sensor) { Array values = Enum.GetValues(typeof(GridGoal)); int goalNum = (int)CurrentGoal; // 현재 에이전트의 x, y 좌표 위치 값을 관측 정보에 추가 sensor.AddObservation(agentTrans.position.x); sensor.AddObservation(agentTrans.position.z); // 각각 도형에 대한 좌표 위치 값을 관측 정보에 추가 List<int> otherPos = area.otherPos; for (int i = 0; i < otherPos.Count; i++) sensor.AddObservation(otherPos[i]); // 목표 지점에 대한 정보 m_GoalSensor.GetSensor().AddOneHotObservation(goalNum, values.Length); } public override void WriteDiscreteActionMask(IDiscreteActionMask actionMask) { // Mask the necessary actions if selected by the user. if (maskActions) { // Prevents the agent from picking an action that would make it collide with a wall var positionX = (int)agentTrans.localPosition.x; var positionZ = (int)agentTrans.localPosition.z; var maxPosition = (int)m_ResetParams.GetWithDefault("gridSize", 5f) - 1; if (positionX == 0) { actionMask.SetActionEnabled(0, k_Left, false); } if (positionX == maxPosition) { actionMask.SetActionEnabled(0, k_Right, false); } if (positionZ == 0) { actionMask.SetActionEnabled(0, k_Down, false); } if (positionZ == maxPosition) { actionMask.SetActionEnabled(0, k_Up, false); } } } // to be implemented by the developer public override void OnActionReceived(ActionBuffers actionBuffers) { // 매 행동마다 -0.01 보상(패널티) 부여 AddReward(-0.01f); var action = actionBuffers.DiscreteActions[0]; // 에이전트가 이동하게 될 위치 값을 저장할 변수 (Vector3) var targetPos = agentTrans.position; switch (action) { case k_NoAction: // do nothing break; case k_Right: // 부여받은 행동이 오른쪽이라면, targetPos = agentTrans.position + moveRight; // 현재 위치에서 1만큼 x축 방향으로 설정 break; case k_Left: targetPos = agentTrans.position + moveLeft; break; case k_Up: targetPos = agentTrans.position + moveUp; break; case k_Down: targetPos = agentTrans.position + moveDown; break; default: throw new ArgumentException("Invalid action value"); } var hit = Physics.OverlapBox( targetPos, new Vector3(0.3f, 0.3f, 0.3f)); // 벽에 부딪히지 않았다면, if (hit.Where(col => col.gameObject.CompareTag("wall")).ToArray().Length == 0) { // 정해진 위치로 이동 agentTrans.position = targetPos; // +오브젝트 만났다면, if (hit.Where(col => col.gameObject.CompareTag("plus")).ToArray().Length == 1) { ProvideReward(GridGoal.GreenPlus); EndEpisode(); } // x오브젝트 만났다면, else if (hit.Where(col => col.gameObject.CompareTag("ex")).ToArray().Length == 1) { ProvideReward(GridGoal.RedEx); EndEpisode(); } } } private void ProvideReward(GridGoal hitObject) { if (CurrentGoal == hitObject) { SetReward(1f); } else { SetReward(-1f); } } // WASD 키보드로 에이전트 이동 public override void Heuristic(in ActionBuffers actionsOut) { var discreteActionsOut = actionsOut.DiscreteActions; discreteActionsOut[0] = k_NoAction; if (Input.GetKey(KeyCode.D)) { discreteActionsOut[0] = k_Right; } if (Input.GetKey(KeyCode.W)) { discreteActionsOut[0] = k_Up; } if (Input.GetKey(KeyCode.A)) { discreteActionsOut[0] = k_Left; } if (Input.GetKey(KeyCode.S)) { discreteActionsOut[0] = k_Down; } } // to be implemented by the developer public override void OnEpisodeBegin() { area.AreaReset(); Array values = Enum.GetValues(typeof(GridGoal)); CurrentGoal = (GridGoal)values.GetValue(UnityEngine.Random.Range(0, values.Length)); } public void FixedUpdate() { WaitTimeInference(); } void WaitTimeInference() { if (renderCamera != null && SystemInfo.graphicsDeviceType != GraphicsDeviceType.Null) { renderCamera.Render(); } if (Academy.Instance.IsCommunicatorOn) { RequestDecision(); } else { if (m_TimeSinceDecision >= timeBetweenDecisionsAtInference) { m_TimeSinceDecision = 0f; RequestDecision(); } else { m_TimeSinceDecision += Time.fixedDeltaTime; } } } }
-
해결됨강화학습 입문에서 Deep Q-learning/Policy Gradient까지
실습-얼어붙은 호수(Frozen Lake) - 정책 반복 알고리즘 구현 argmax
안녕하세요 아래와 같이 new_action_values 의 max 값이 복수개 발견될경우 맨처음 발견된 index 만 표시 되는게 맞는건가요?예를 들어 액션값이 좌측이거나 위 .. 이렇게 두개의 값은 갖을 수 없는건가요? V = np.zeros(num_states) pi = np.ones([num_states, num_actions]) * 0.25 new_action_values = np.array([0.1, 0.5, 0.5, 0.5]) new_action = np.argmax(new_action_values) print(new_action) print(np.eye(num_actions)) print(np.eye(num_actions)[new_action])
-
미해결유니티 머신러닝 에이전트 완전정복 (기초편)
2025년 pip ml agents 설치 에러
이 부분에서 설치시에 계속 에러가 나네요 ㅠㅠERROR: Could not find a version that satisfies the requirement mlagents==0.30.0 (from versions: 0.4.0, 0.10.0.dev1, 0.10.0, 0.10.1, 0.11.0.dev0, 0.11.0, 0.12.0, 0.12.1, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.17.0, 0.18.0, 0.18.1, 0.19.0, 0.20.0, 0.21.0, 0.21.1, 0.22.0, 0.23.0, 0.24.0, 0.24.1, 0.25.0, 0.25.1, 0.26.0, 0.27.0, 0.28.0)ERROR: No matching distribution found for mlagents==0.30.0.
-
미해결모두를 위한 딥러닝 - 기본적인 머신러닝과 딥러닝 강좌
computation graph 만드는 부분에서 마지만 출력오류
Session 부분이 없다는 걸로 나오는데,, 그럼 아래와 같이 출력이 되려면 코드를 어떻게 수정해야 할까요?
-
미해결TensorFlow로 배우는 심층 강화학습 입문 - Deep Reinforcement Learning
코드 첫 라인부터 오류납니다.
코드 첫 라인부터 오류납니다.확인해서 다시 올려주세요. --------------------------------------------------------------------------- CalledProcessError Traceback (most recent call last) <ipython-input-5-4f475c98efa9> in <cell line: 0>() ----> 1 get_ipython().run_cell_magic('bash', '', '# Install additional packages for visualization\nsudo apt-get update\nsudo apt-get install -y xvfb python-opengl > /dev/null 2>&1\npip install pyvirtualdisplay > /dev/null 2>&1\npip install git+https://github.com/tensorflow/docs > /dev/null 2>&1\npip install gym[classic_control]\n') 4 frames<decorator-gen-103> in shebang(self, line, cell) /usr/local/lib/python3.11/dist-packages/IPython/core/magics/script.py in shebang(self, line, cell) 243 sys.stderr.flush() 244 if args.raise_error and p.returncode!=0: --> 245 raise CalledProcessError(p.returncode, cell, output=out, stderr=err) 246 247 def _run_script(self, p, cell, to_close): CalledProcessError: Command 'b'# Install additional packages for visualization\nsudo apt-get update\nsudo apt-get install -y xvfb python-opengl > /dev/null 2>&1\npip install pyvirtualdisplay > /dev/null 2>&1\npip install git+https://github.com/tensorflow/docs > /dev/null 2>&1\npip install gym[classic_control]\n'' returned non-zero exit status 1.
-
미해결강화학습 입문에서 Deep Q-learning/Policy Gradient까지
실습에러 TImelimit
안녕하세요. Frozen lake 실습에서 해당 코드 실행하면 에러가 나옵니다.ㅜㅜ코드 잘못짠건 아니고 올려주신 파일 그대로 실행했을때 에러납니다.에러코드transitions = env.P 여기서 문제가 생기는것 같습니다.감사합니다.
-
해결됨강화학습 입문에서 Deep Q-learning/Policy Gradient까지
실습
안녕하세요. 말씀하신대로cd 디렉토리명 입력하고 code .입력하면code 는 내부 또는 외부명렬 실행할수 있는 프로그램 또는 배치 파일이 아닙니다 라고 나옵니다. 또 spyder 에서 001 cart visualize 를 실행해봤는데 No module named 'gymnaisum' 이 나옵니다.pip install gymnasium 은 해놓은 상태이고 gym 이 설치되있는것까지 확인했습니다. 어떻게 해결하면 될까요? 감사합니다.
-
해결됨강화학습 입문에서 Deep Q-learning/Policy Gradient까지
강의자료
강의자료는 따로 없나요?