import{s as He,o as Ve,n as ge}from"../chunks/scheduler.bdbef820.js";import{S as Se,i as Ee,g as c,s,r as h,A as Ie,h as m,f as o,c as i,j as O,u as g,x as v,k as K,y as p,a,v as u,d as y,t as _,w as T}from"../chunks/index.33f81d56.js";import{T as Ne}from"../chunks/Tip.34194030.js";import{D as $e}from"../chunks/Docstring.662771b3.js";import{C as Ye}from"../chunks/CodeBlock.3bad7fc9.js";import{E as Fe}from"../chunks/ExampleCodeBlock.32707fc1.js";import{H as ee,E as qe}from"../chunks/index.e01163b6.js";function Qe(x){let r,d=`이 모델은 유지 보수 모드로만 운영되며, 코드를 변경하는 새로운 PR(Pull Request)은 받지 않습니다.
이 모델을 실행하는 데 문제가 발생한다면, 이 모델을 지원하는 마지막 버전인 v4.30.0를 다시 설치해 주세요. 다음 명령어를 실행하여 재설치할 수 있습니다: <code>pip install -U transformers==4.30.0</code>.`;return{c(){r=c("p"),r.innerHTML=d},l(n){r=m(n,"P",{"data-svelte-h":!0}),v(r)!=="svelte-1fgnu8x"&&(r.innerHTML=d)},m(n,f){a(n,r,f)},p:ge,d(n){n&&o(r)}}}function Pe(x){let r,d;return r=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWplY3RvcnlUcmFuc2Zvcm1lckNvbmZpZyUyQyUyMFRyYWplY3RvcnlUcmFuc2Zvcm1lck1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFRyYWplY3RvcnlUcmFuc2Zvcm1lciUyMENhcmxDb2NoZXQlMkZ0cmFqZWN0b3J5LXRyYW5zZm9ybWVyLWhhbGZjaGVldGFoLW1lZGl1bS12MiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBUcmFqZWN0b3J5VHJhbnNmb3JtZXJDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwQ2FybENvY2hldCUyRnRyYWplY3RvcnktdHJhbnNmb3JtZXItaGFsZmNoZWV0YWgtbWVkaXVtLXYyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBUcmFqZWN0b3J5VHJhbnNmb3JtZXJNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrajectoryTransformerConfig, TrajectoryTransformerModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a TrajectoryTransformer CarlCochet/trajectory-transformer-halfcheetah-medium-v2 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = TrajectoryTransformerConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the CarlCochet/trajectory-transformer-halfcheetah-medium-v2 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TrajectoryTransformerModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){h(r.$$.fragment)},l(n){g(r.$$.fragment,n)},m(n,f){u(r,n,f),d=!0},p:ge,i(n){d||(y(r.$$.fragment,n),d=!0)},o(n){_(r.$$.fragment,n),d=!1},d(n){T(r,n)}}}function Xe(x){let r,d=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=c("p"),r.innerHTML=d},l(n){r=m(n,"P",{"data-svelte-h":!0}),v(r)!=="svelte-fincs2"&&(r.innerHTML=d)},m(n,f){a(n,r,f)},p:ge,d(n){n&&o(r)}}}function Be(x){let r,d="Examples:",n,f,M;return f=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWplY3RvcnlUcmFuc2Zvcm1lck1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbCUyMCUzRCUyMFRyYWplY3RvcnlUcmFuc2Zvcm1lck1vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJDYXJsQ29jaGV0JTJGdHJhamVjdG9yeS10cmFuc2Zvcm1lci1oYWxmY2hlZXRhaC1tZWRpdW0tdjIlMjIlMEEpJTBBbW9kZWwudG8oZGV2aWNlKSUwQW1vZGVsLmV2YWwoKSUwQSUwQW9ic2VydmF0aW9uc19kaW0lMkMlMjBhY3Rpb25fZGltJTJDJTIwYmF0Y2hfc2l6ZSUyMCUzRCUyMDE3JTJDJTIwNiUyQyUyMDI1NiUwQXNlcV9sZW5ndGglMjAlM0QlMjBvYnNlcnZhdGlvbnNfZGltJTIwJTJCJTIwYWN0aW9uX2RpbSUyMCUyQiUyMDElMEElMEF0cmFqZWN0b3JpZXMlMjAlM0QlMjB0b3JjaC5Mb25nVGVuc29yKCU1Qm5wLnJhbmRvbS5wZXJtdXRhdGlvbihzZWxmLnNlcV9sZW5ndGgpJTIwZm9yJTIwXyUyMGluJTIwcmFuZ2UoYmF0Y2hfc2l6ZSklNUQpLnRvKCUwQSUyMCUyMCUyMCUyMGRldmljZSUwQSklMEF0YXJnZXRzJTIwJTNEJTIwdG9yY2guTG9uZ1RlbnNvciglNUJucC5yYW5kb20ucGVybXV0YXRpb24oc2VsZi5zZXFfbGVuZ3RoKSUyMGZvciUyMF8lMjBpbiUyMHJhbmdlKGJhdGNoX3NpemUpJTVEKS50byhkZXZpY2UpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCUwQSUyMCUyMCUyMCUyMHRyYWplY3RvcmllcyUyQyUwQSUyMCUyMCUyMCUyMHRhcmdldHMlM0R0YXJnZXRzJTJDJTBBJTIwJTIwJTIwJTIwdXNlX2NhY2hlJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF9hdHRlbnRpb25zJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF9oaWRkZW5fc3RhdGVzJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHJldHVybl9kaWN0JTNEVHJ1ZSUyQyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrajectoryTransformerModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TrajectoryTransformerModel.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;CarlCochet/trajectory-transformer-halfcheetah-medium-v2&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">eval</span>()

<span class="hljs-meta">&gt;&gt;&gt; </span>observations_dim, action_dim, batch_size = <span class="hljs-number">17</span>, <span class="hljs-number">6</span>, <span class="hljs-number">256</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>seq_length = observations_dim + action_dim + <span class="hljs-number">1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>trajectories = torch.LongTensor([np.random.permutation(self.seq_length) <span class="hljs-keyword">for</span> _ <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(batch_size)]).to(
<span class="hljs-meta">... </span>    device
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>targets = torch.LongTensor([np.random.permutation(self.seq_length) <span class="hljs-keyword">for</span> _ <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(batch_size)]).to(device)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(
<span class="hljs-meta">... </span>    trajectories,
<span class="hljs-meta">... </span>    targets=targets,
<span class="hljs-meta">... </span>    use_cache=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    output_attentions=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    output_hidden_states=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    return_dict=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){r=c("p"),r.textContent=d,n=s(),h(f.$$.fragment)},l(l){r=m(l,"P",{"data-svelte-h":!0}),v(r)!=="svelte-kvfsh7"&&(r.textContent=d),n=i(l),g(f.$$.fragment,l)},m(l,w){a(l,r,w),a(l,n,w),u(f,l,w),M=!0},p:ge,i(l){M||(y(f.$$.fragment,l),M=!0)},o(l){_(f.$$.fragment,l),M=!1},d(l){l&&(o(r),o(n)),T(f,l)}}}function De(x){let r,d,n,f,M,l,w,te,R,re,z,Ce='Trajectory Transformer 모델은 Michael Janner, Qiyang Li, Sergey Levine이 제안한 <a href="https://arxiv.org/abs/2106.02039" rel="nofollow">하나의 커다란 시퀀스 모델링 문제로서의 오프라인 강화학습</a>라는 논문에서 소개되었습니다.',oe,G,Ue="해당 논문의 초록입니다:",ne,L,ke="<em>강화학습(RL)은 일반적으로 마르코프 속성을 활용하여 시간에 따라 문제를 인수분해하면서 정적 정책이나 단일 단계 모델을 추정하는 데 중점을 둡니다. 하지만 우리는 RL을 높은 보상 시퀀스로 이어지는 행동 시퀀스를 생성하는 것을 목표로 하는 일반적인 시퀀스 모델링 문제로 볼 수도 있습니다. 이러한 관점에서, 자연어 처리와 같은 다른 도메인에서 잘 작동하는 고용량 시퀀스 예측 모델이 RL 문제에도 효과적인 해결책을 제공할 수 있는지 고려해 볼 만합니다. 이를 위해 우리는 RL을 시퀀스 모델링의 도구로 어떻게 다룰 수 있는지 탐구하며, 트랜스포머 아키텍처를 사용하여 궤적에 대한 분포를 모델링하고 빔 서치를 계획 알고리즘으로 재활용합니다. RL을 시퀀스 모델링 문제로 프레임화하면 다양한 설계 결정이 단순화되어, 오프라인 RL 알고리즘에서 흔히 볼 수 있는 많은 구성 요소를 제거할 수 있습니다. 우리는 이 접근 방식의 유연성을 장기 동역학 예측, 모방 학습, 목표 조건부 RL, 오프라인 RL에 걸쳐 입증합니다. 더 나아가, 이 접근 방식을 기존의 모델 프리 알고리즘과 결합하여 희소 보상, 장기 과제에서 최신 계획기(planner)를 얻을 수 있음을 보여줍니다.</em>",ae,N,xe=`이 모델은 <a href="https://huggingface.co/CarlCochet" rel="nofollow">CarlCochet</a>에 의해 기여되었습니다.
원본 코드는 <a href="https://github.com/jannerm/trajectory-transformer" rel="nofollow">이곳</a>에서 확인할 수 있습니다.`,se,F,ie,Y,Je="이 트랜스포머는 심층 강화학습에 사용됩니다. 사용하려면 이전의 모든 타임스텝에서의 행동, 상태, 보상으로부터 시퀀스를 생성해야 합니다. 이 모델은 이 모든 요소를 함께 하나의 큰 시퀀스(궤적)로 취급합니다.",le,H,ce,j,V,ue,Q,Ze=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/ko/model_doc/trajectory_transformer#transformers.TrajectoryTransformerModel">TrajectoryTransformerModel</a>. It is used to
instantiate an TrajectoryTransformer model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the
TrajectoryTransformer
<a href="https://huggingface.co/CarlCochet/trajectory-transformer-halfcheetah-medium-v2" rel="nofollow">CarlCochet/trajectory-transformer-halfcheetah-medium-v2</a>
architecture.`,ye,P,We=`Configuration objects inherit from <a href="/docs/transformers/main/ko/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/ko/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,_e,J,me,S,de,b,E,Te,X,Re=`The bare TrajectoryTransformer Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,je,B,ze="the full GPT language model, with a context size of block_size",be,$,I,ve,D,Ge='The <a href="/docs/transformers/main/ko/model_doc/trajectory_transformer#transformers.TrajectoryTransformerModel">TrajectoryTransformerModel</a> forward method, overrides the <code>__call__</code> special method.',Me,Z,we,W,fe,q,pe,A,he;return M=new ee({props:{title:"궤적 트랜스포머",local:"trajectory-transformer",headingTag:"h1"}}),w=new Ne({props:{warning:!0,$$slots:{default:[Qe]},$$scope:{ctx:x}}}),R=new ee({props:{title:"개요",local:"overview",headingTag:"h2"}}),F=new ee({props:{title:"사용 팁",local:"usage-tips",headingTag:"h2"}}),H=new ee({props:{title:"TrajectoryTransformerConfig",local:"transformers.TrajectoryTransformerConfig ][ transformers.TrajectoryTransformerConfig",headingTag:"h2"}}),V=new $e({props:{name:"class transformers.TrajectoryTransformerConfig",anchor:"transformers.TrajectoryTransformerConfig",parameters:[{name:"vocab_size",val:" = 100"},{name:"action_weight",val:" = 5"},{name:"reward_weight",val:" = 1"},{name:"value_weight",val:" = 1"},{name:"block_size",val:" = 249"},{name:"action_dim",val:" = 6"},{name:"observation_dim",val:" = 17"},{name:"transition_dim",val:" = 25"},{name:"n_layer",val:" = 4"},{name:"n_head",val:" = 4"},{name:"n_embd",val:" = 128"},{name:"embd_pdrop",val:" = 0.1"},{name:"attn_pdrop",val:" = 0.1"},{name:"resid_pdrop",val:" = 0.1"},{name:"learning_rate",val:" = 0.0006"},{name:"max_position_embeddings",val:" = 512"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"kaiming_initializer_range",val:" = 1"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 50256"},{name:"eos_token_id",val:" = 50256"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TrajectoryTransformerConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
Vocabulary size of the TrajectoryTransformer model. Defines the number of different tokens that can be
represented by the <code>trajectories</code> passed when calling <a href="/docs/transformers/main/ko/model_doc/trajectory_transformer#transformers.TrajectoryTransformerModel">TrajectoryTransformerModel</a>`,name:"vocab_size"},{anchor:"transformers.TrajectoryTransformerConfig.action_weight",description:`<strong>action_weight</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Weight of the action in the loss function`,name:"action_weight"},{anchor:"transformers.TrajectoryTransformerConfig.reward_weight",description:`<strong>reward_weight</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Weight of the reward in the loss function`,name:"reward_weight"},{anchor:"transformers.TrajectoryTransformerConfig.value_weight",description:`<strong>value_weight</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Weight of the value in the loss function`,name:"value_weight"},{anchor:"transformers.TrajectoryTransformerConfig.block_size",description:`<strong>block_size</strong> (<code>int</code>, <em>optional</em>, defaults to 249) &#x2014;
Size of the blocks in the trajectory transformer.`,name:"block_size"},{anchor:"transformers.TrajectoryTransformerConfig.action_dim",description:`<strong>action_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Dimension of the action space.`,name:"action_dim"},{anchor:"transformers.TrajectoryTransformerConfig.observation_dim",description:`<strong>observation_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 17) &#x2014;
Dimension of the observation space.`,name:"observation_dim"},{anchor:"transformers.TrajectoryTransformerConfig.transition_dim",description:`<strong>transition_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 25) &#x2014;
Dimension of the transition space.`,name:"transition_dim"},{anchor:"transformers.TrajectoryTransformerConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.TrajectoryTransformerConfig.n_head",description:`<strong>n_head</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_head"},{anchor:"transformers.TrajectoryTransformerConfig.n_embd",description:`<strong>n_embd</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Dimensionality of the embeddings and hidden states.`,name:"n_embd"},{anchor:"transformers.TrajectoryTransformerConfig.resid_pdrop",description:`<strong>resid_pdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"resid_pdrop"},{anchor:"transformers.TrajectoryTransformerConfig.embd_pdrop",description:`<strong>embd_pdrop</strong> (<code>int</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the embeddings.`,name:"embd_pdrop"},{anchor:"transformers.TrajectoryTransformerConfig.attn_pdrop",description:`<strong>attn_pdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention.`,name:"attn_pdrop"},{anchor:"transformers.TrajectoryTransformerConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.TrajectoryTransformerConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.TrajectoryTransformerConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.TrajectoryTransformerConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.TrajectoryTransformerConfig.kaiming_initializer_range",description:"<strong>kaiming_initializer_range</strong> (`float, <em>optional</em>, defaults to 1) &#x2014;\nA coefficient scaling the negative slope of the kaiming initializer rectifier for EinLinear layers.",name:"kaiming_initializer_range"},{anchor:"transformers.TrajectoryTransformerConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.TrajectoryTransformerConfig.Example",description:"<strong>Example</strong> &#x2014;",name:"Example"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py#L24"}}),J=new Fe({props:{anchor:"transformers.TrajectoryTransformerConfig.example",$$slots:{default:[Pe]},$$scope:{ctx:x}}}),S=new ee({props:{title:"TrajectoryTransformerModel",local:"transformers.TrajectoryTransformerModel ][ transformers.TrajectoryTransformerModel",headingTag:"h2"}}),E=new $e({props:{name:"class transformers.TrajectoryTransformerModel",anchor:"transformers.TrajectoryTransformerModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.TrajectoryTransformerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/ko/model_doc/trajectory_transformer#transformers.TrajectoryTransformerConfig">TrajectoryTransformerConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/ko/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py#L394"}}),I=new $e({props:{name:"forward",anchor:"transformers.TrajectoryTransformerModel.forward",parameters:[{name:"trajectories",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.Tensor]]] = None"},{name:"targets",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TrajectoryTransformerModel.forward.trajectories",description:`<strong>trajectories</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Batch of trajectories, where a trajectory is a sequence of states, actions and rewards.`,name:"trajectories"},{anchor:"transformers.TrajectoryTransformerModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code> of length <code>config.n_layers</code>, <em>optional</em>) &#x2014;
Contains precomputed hidden-states (key and values in the attention blocks) as computed by the model (see
<code>past_key_values</code> output below). Can be used to speed up sequential decoding. The <code>input_ids</code> which have
their past given to this model should not be passed as <code>input_ids</code> as they have already been computed.`,name:"past_key_values"},{anchor:"transformers.TrajectoryTransformerModel.forward.targets",description:`<strong>targets</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Desired targets used to compute the loss.`,name:"targets"},{anchor:"transformers.TrajectoryTransformerModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TrajectoryTransformerModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.TrajectoryTransformerModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TrajectoryTransformerModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TrajectoryTransformerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/ko/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py#L459",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.deprecated.trajectory_transformer.modeling_trajectory_transformer.TrajectoryTransformerOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/ko/model_doc/trajectory_transformer#transformers.TrajectoryTransformerConfig"
>TrajectoryTransformerConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Language modeling loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</li>
<li><strong>past_key_values</strong> (<code>Tuple[Tuple[torch.Tensor]]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — Tuple of length <code>config.n_layers</code>, containing tuples of tensors of shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). Contains pre-computed hidden-states (key and values in the
attention blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
<li><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. GPT2Attentions weights after the attention softmax, used to compute the weighted average
in the self-attention heads.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.deprecated.trajectory_transformer.modeling_trajectory_transformer.TrajectoryTransformerOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Z=new Ne({props:{$$slots:{default:[Xe]},$$scope:{ctx:x}}}),W=new Fe({props:{anchor:"transformers.TrajectoryTransformerModel.forward.example",$$slots:{default:[Be]},$$scope:{ctx:x}}}),q=new qe({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/model_doc/trajectory_transformer.md"}}),{c(){r=c("meta"),d=s(),n=c("p"),f=s(),h(M.$$.fragment),l=s(),h(w.$$.fragment),te=s(),h(R.$$.fragment),re=s(),z=c("p"),z.innerHTML=Ce,oe=s(),G=c("p"),G.textContent=Ue,ne=s(),L=c("p"),L.innerHTML=ke,ae=s(),N=c("p"),N.innerHTML=xe,se=s(),h(F.$$.fragment),ie=s(),Y=c("p"),Y.textContent=Je,le=s(),h(H.$$.fragment),ce=s(),j=c("div"),h(V.$$.fragment),ue=s(),Q=c("p"),Q.innerHTML=Ze,ye=s(),P=c("p"),P.innerHTML=We,_e=s(),h(J.$$.fragment),me=s(),h(S.$$.fragment),de=s(),b=c("div"),h(E.$$.fragment),Te=s(),X=c("p"),X.innerHTML=Re,je=s(),B=c("p"),B.textContent=ze,be=s(),$=c("div"),h(I.$$.fragment),ve=s(),D=c("p"),D.innerHTML=Ge,Me=s(),h(Z.$$.fragment),we=s(),h(W.$$.fragment),fe=s(),h(q.$$.fragment),pe=s(),A=c("p"),this.h()},l(e){const t=Ie("svelte-u9bgzb",document.head);r=m(t,"META",{name:!0,content:!0}),t.forEach(o),d=i(e),n=m(e,"P",{}),O(n).forEach(o),f=i(e),g(M.$$.fragment,e),l=i(e),g(w.$$.fragment,e),te=i(e),g(R.$$.fragment,e),re=i(e),z=m(e,"P",{"data-svelte-h":!0}),v(z)!=="svelte-qac26x"&&(z.innerHTML=Ce),oe=i(e),G=m(e,"P",{"data-svelte-h":!0}),v(G)!=="svelte-un5jih"&&(G.textContent=Ue),ne=i(e),L=m(e,"P",{"data-svelte-h":!0}),v(L)!=="svelte-19ekmy"&&(L.innerHTML=ke),ae=i(e),N=m(e,"P",{"data-svelte-h":!0}),v(N)!=="svelte-1qaj9c3"&&(N.innerHTML=xe),se=i(e),g(F.$$.fragment,e),ie=i(e),Y=m(e,"P",{"data-svelte-h":!0}),v(Y)!=="svelte-1tmmqs7"&&(Y.textContent=Je),le=i(e),g(H.$$.fragment,e),ce=i(e),j=m(e,"DIV",{class:!0});var C=O(j);g(V.$$.fragment,C),ue=i(C),Q=m(C,"P",{"data-svelte-h":!0}),v(Q)!=="svelte-tfi8nx"&&(Q.innerHTML=Ze),ye=i(C),P=m(C,"P",{"data-svelte-h":!0}),v(P)!=="svelte-qr3t5r"&&(P.innerHTML=We),_e=i(C),g(J.$$.fragment,C),C.forEach(o),me=i(e),g(S.$$.fragment,e),de=i(e),b=m(e,"DIV",{class:!0});var U=O(b);g(E.$$.fragment,U),Te=i(U),X=m(U,"P",{"data-svelte-h":!0}),v(X)!=="svelte-d660au"&&(X.innerHTML=Re),je=i(U),B=m(U,"P",{"data-svelte-h":!0}),v(B)!=="svelte-1oiyixz"&&(B.textContent=ze),be=i(U),$=m(U,"DIV",{class:!0});var k=O($);g(I.$$.fragment,k),ve=i(k),D=m(k,"P",{"data-svelte-h":!0}),v(D)!=="svelte-6voz3f"&&(D.innerHTML=Ge),Me=i(k),g(Z.$$.fragment,k),we=i(k),g(W.$$.fragment,k),k.forEach(o),U.forEach(o),fe=i(e),g(q.$$.fragment,e),pe=i(e),A=m(e,"P",{}),O(A).forEach(o),this.h()},h(){K(r,"name","hf:doc:metadata"),K(r,"content",Ae),K(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){p(document.head,r),a(e,d,t),a(e,n,t),a(e,f,t),u(M,e,t),a(e,l,t),u(w,e,t),a(e,te,t),u(R,e,t),a(e,re,t),a(e,z,t),a(e,oe,t),a(e,G,t),a(e,ne,t),a(e,L,t),a(e,ae,t),a(e,N,t),a(e,se,t),u(F,e,t),a(e,ie,t),a(e,Y,t),a(e,le,t),u(H,e,t),a(e,ce,t),a(e,j,t),u(V,j,null),p(j,ue),p(j,Q),p(j,ye),p(j,P),p(j,_e),u(J,j,null),a(e,me,t),u(S,e,t),a(e,de,t),a(e,b,t),u(E,b,null),p(b,Te),p(b,X),p(b,je),p(b,B),p(b,be),p(b,$),u(I,$,null),p($,ve),p($,D),p($,Me),u(Z,$,null),p($,we),u(W,$,null),a(e,fe,t),u(q,e,t),a(e,pe,t),a(e,A,t),he=!0},p(e,[t]){const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),w.$set(C);const U={};t&2&&(U.$$scope={dirty:t,ctx:e}),J.$set(U);const k={};t&2&&(k.$$scope={dirty:t,ctx:e}),Z.$set(k);const Le={};t&2&&(Le.$$scope={dirty:t,ctx:e}),W.$set(Le)},i(e){he||(y(M.$$.fragment,e),y(w.$$.fragment,e),y(R.$$.fragment,e),y(F.$$.fragment,e),y(H.$$.fragment,e),y(V.$$.fragment,e),y(J.$$.fragment,e),y(S.$$.fragment,e),y(E.$$.fragment,e),y(I.$$.fragment,e),y(Z.$$.fragment,e),y(W.$$.fragment,e),y(q.$$.fragment,e),he=!0)},o(e){_(M.$$.fragment,e),_(w.$$.fragment,e),_(R.$$.fragment,e),_(F.$$.fragment,e),_(H.$$.fragment,e),_(V.$$.fragment,e),_(J.$$.fragment,e),_(S.$$.fragment,e),_(E.$$.fragment,e),_(I.$$.fragment,e),_(Z.$$.fragment,e),_(W.$$.fragment,e),_(q.$$.fragment,e),he=!1},d(e){e&&(o(d),o(n),o(f),o(l),o(te),o(re),o(z),o(oe),o(G),o(ne),o(L),o(ae),o(N),o(se),o(ie),o(Y),o(le),o(ce),o(j),o(me),o(de),o(b),o(fe),o(pe),o(A)),o(r),T(M,e),T(w,e),T(R,e),T(F,e),T(H,e),T(V),T(J),T(S,e),T(E),T(I),T(Z),T(W),T(q,e)}}}const Ae='{"title":"궤적 트랜스포머","local":"trajectory-transformer","sections":[{"title":"개요","local":"overview","sections":[],"depth":2},{"title":"사용 팁","local":"usage-tips","sections":[],"depth":2},{"title":"TrajectoryTransformerConfig","local":"transformers.TrajectoryTransformerConfig ][ transformers.TrajectoryTransformerConfig","sections":[],"depth":2},{"title":"TrajectoryTransformerModel","local":"transformers.TrajectoryTransformerModel ][ transformers.TrajectoryTransformerModel","sections":[],"depth":2}],"depth":1}';function Oe(x){return Ve(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class st extends Se{constructor(r){super(),Ee(this,r,Oe,De,He,{})}}export{st as component};
