o
    ci                     @   sp   d dl mZmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZmZmZ dZdZG d	d
 d
eZdS )    )DictOptionalValueFunctionAPI)Learner)override)LambdaDefaultDict)ModuleIDShouldModuleBeUpdatedFn
TensorTypemoving_avg_sqd_adv_normvf_explained_variancec                       sp   e Zd Zeed fddZeedddedee ddf fdd	Z	e
eedee fd
dZ  ZS )MARWILLearnerreturnNc                    s    t    t fdd _d S )Nc                    s      j| jS N)_get_tensor_variableconfigget_config_for_module!moving_average_sqd_adv_norm_start)	module_idself ^/home/ubuntu/.local/lib/python3.10/site-packages/ray/rllib/algorithms/marwil/marwil_learner.py<lambda>   s    z%MARWILLearner.build.<locals>.<lambda>)superbuildr   #moving_avg_sqd_adv_norms_per_moduler   	__class__r   r   r      s
   

zMARWILLearner.buildnew_should_module_be_updatedr   r!   c                   s"   t  j||d | j|d  d S )Nr    )r   remove_moduler   pop)r   r   r!   r   r   r   r"       s
   zMARWILLearner.remove_modulec                 C   s   t gS r   r   )clsr   r   r   rl_module_required_apis.   s   z%MARWILLearner.rl_module_required_apis)r   N)__name__
__module____qualname__r   r   r   r	   r   r
   r"   classmethodlisttyper%   __classcell__r   r   r   r   r      s    r   N)typingr   r   ray.rllib.core.rl_module.apisr   ray.rllib.core.learner.learnerr   ray.rllib.utils.annotationsr   "ray.rllib.utils.lambda_defaultdictr   ray.rllib.utils.typingr	   r
   r   +LEARNER_RESULTS_MOVING_AVG_SQD_ADV_NORM_KEY$LEARNER_RESULTS_VF_EXPLAINED_VAR_KEYr   r   r   r   r   <module>   s    