
    Ki                     x    S SK r S SKJs  Jr  S SKJr  S SKJr  S SKJ	r	  S SK
Jr   " S S\R                  5      rg)    N)analysis)SNPE)posterior_nnc                   2   ^  \ rS rSrSU 4S jjrS rSrU =r$ )PopulationEmbeddingFull   c                   > [         TU ]  5         [        R                  " [        R                  " X5      [        R
                  " 5       [        R                  " X"5      [        R
                  " 5       5      U l        [        R                  " US5      U l        [        R                  " [        R                  " X"5      [        R
                  " 5       [        R                  " X#5      5      U l        g )N   )	super__init__nn
SequentialLinearReLUphi	attentionrho)self	input_dim
hidden_dim
output_dim	__class__s       M/global/cfs/cdirs/lsst/www/DESC_TD_PUBLIC/users/bastienc/kestrel/dustbi_nn.pyr    PopulationEmbeddingFull.__init__	   s    ==IIi,GGIIIj-GGI	
 :q1==IIj-GGIIIj-
    c                     U R                  U5      n[        R                  " U R                  U5      SS9nX#-  R	                  SS9nU R                  U5      $ )Nr
   )dim)r   torchsoftmaxr   sumr   )r   xhws       r   forwardPopulationEmbeddingFull.forward   sH    HHQKMM$..+3UKKAKxx{r   )r   r   r   )   @       )__name__
__module____qualname____firstlineno__r   r$   __static_attributes____classcell__)r   s   @r   r   r      s    
 r   r   )r   torch.nn.functionalr   
functionalFtorch.nnsbir   sbi.inferencer   sbi.neural_netsr   Moduler    r   r   <module>r8      s*        $  (bii r   