Upload modeling_moment.py
Browse files- modeling_moment.py +2 -1
modeling_moment.py
CHANGED
|
@@ -366,6 +366,7 @@ class MomentEmbeddingModel(MomentPreTrainedModel):
|
|
| 366 |
self.config = config
|
| 367 |
self.seq_len = config.seq_len
|
| 368 |
self.patch_len = config.patch_len
|
|
|
|
| 369 |
|
| 370 |
# TODO: normalizer, tokenizerはProcessor側に配置するべきか?
|
| 371 |
# 現状の考え: 特にMomentから切り離す用途もない。
|
|
@@ -515,7 +516,7 @@ class MomentEmbeddingModel(MomentPreTrainedModel):
|
|
| 515 |
Returns:
|
| 516 |
int: 計算されたn_patchesの数
|
| 517 |
"""
|
| 518 |
-
stride = self.
|
| 519 |
n_patches = (seq_len - self.patch_len) // stride + 1
|
| 520 |
return n_patches
|
| 521 |
|
|
|
|
| 366 |
self.config = config
|
| 367 |
self.seq_len = config.seq_len
|
| 368 |
self.patch_len = config.patch_len
|
| 369 |
+
self.patch_stride_len = config.patch_stride_len
|
| 370 |
|
| 371 |
# TODO: normalizer, tokenizerはProcessor側に配置するべきか?
|
| 372 |
# 現状の考え: 特にMomentから切り離す用途もない。
|
|
|
|
| 516 |
Returns:
|
| 517 |
int: 計算されたn_patchesの数
|
| 518 |
"""
|
| 519 |
+
stride = self.patch_stride_len if self.patch_stride_len is not None else self.patch_len
|
| 520 |
n_patches = (seq_len - self.patch_len) // stride + 1
|
| 521 |
return n_patches
|
| 522 |
|