forked from Ladbaby/project_2024_LaTeX_OCR_Pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix cuda error,add positional embedding
- Loading branch information
Showing
121 changed files
with
133 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,6 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# train result | ||
*.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
#数据路径 | ||
data_name = 'small_test' # 模型名称,仅在保存的时候用到 | ||
vocab_path = 'vocab.json' | ||
vocab_path = './data/small/vocab.json' | ||
train_set_path = './data/small/train.json' | ||
val_set_path = './data/small/val.json' | ||
|
||
|
||
# 模型参数 | ||
emb_dim = 30 # 词嵌入维数80 | ||
attention_dim = 8 # attention 层维度 256 | ||
decoder_dim = 4 # decoder维度 128 | ||
emb_dim = 80 # 词嵌入维数80 | ||
attention_dim = 256 # attention 层维度 256 | ||
decoder_dim = 512 # decoder维度 128 | ||
dropout = 0.5 | ||
|
||
''' | ||
如果网络的输入数据维度或类型上变化不大,设置 torch.backends.cudnn.benchmark = true 可以增加运行效率; | ||
如果网络的输入数据在每次 iteration 都变化的话,会导致 cnDNN 每次都会去寻找一遍最优配置,这样反而会降低运行效率。 | ||
''' | ||
|
||
# 训练参数 | ||
start_epoch = 0 | ||
epochs = 100 # 不触发早停机制时候最大迭代次数 | ||
epochs_since_improvement = 0 # 用于跟踪在验证集上 BLEU分数没有提高的迭代次数 | ||
epochs_since_improvement = 0 # 用于跟踪在验证集上分数没有提高的迭代次数 | ||
batch_size = 2 #训练解批大小 | ||
test_batch_size = 6 #验证集批大小 | ||
encoder_lr = 1e-4 # 学习率 | ||
decoder_lr = 4e-4 # 学习率 | ||
grad_clip = 5. # 梯度裁剪阈值 | ||
alpha_c = 1. # regularization parameter for 'doubly stochastic attention', as in the paper | ||
best_score = 0. # 目前最好的 score | ||
print_freq = 1 # 状态的批次打印间隔 | ||
print_freq = 5 # 状态的批次打印间隔 | ||
checkpoint = None # checkpoint文件目录(用于断点继续训练) | ||
save_freq = 2 #保存的间隔 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"0.png": {"img_path": "./data/small/images/images_test/0.png", "size": [442, 62], "caption": "d s ^ { 2 } = ( 1 - { \\frac { q c o s \\theta } { r } } ) ^ { \\frac { 2 } { 1 + \\alpha ^ { 2 } } } \\lbrace d r ^ { 2 } + r ^ { 2 } d \\theta ^ { 2 } + r ^ { 2 } s i n ^ { 2 } \\theta d \\varphi ^ { 2 } \\rbrace - { \\frac { d t ^ { 2 } } { ( 1 - { \\frac { q c o s \\theta } { r } } ) ^ { \\frac { 2 } { 1 + \\alpha ^ { 2 } } } } } .", "caption_len": 130}, "1.png": {"img_path": "./data/small/images/images_test/1.png", "size": [150, 59], "caption": "\\widetilde \\gamma _ { \\mathrm { h o p f } } \\simeq \\sum _ { n > 0 } \\widetilde { G } _ { n } { \\frac { ( - a ) ^ { n } } { 2 ^ { 2 n - 1 } } }", "caption_len": 53}, "2.png": {"img_path": "./data/small/images/images_test/2.png", "size": [180, 36], "caption": "( { \\cal L } _ { a } g ) _ { i j } = 0 , ( { \\cal L } _ { a } H ) _ { i j k } = 0 ,", "caption_len": 41}, "3.png": {"img_path": "./data/small/images/images_test/3.png", "size": [253, 50], "caption": "S _ { s t a t } = 2 \\pi \\sqrt { N _ { 5 } ^ { ( 1 ) } N _ { 5 } ^ { ( 2 ) } N _ { 5 } ^ { ( 3 ) } } \\left( \\sqrt { n } + \\sqrt { \\bar { n } } \\right)", "caption_len": 63}, "4.png": {"img_path": "./data/small/images/images_test/4.png", "size": [107, 65], "caption": "\\hat { N } _ { 3 } = \\sum \\sp f _ { j = 1 } a _ { j } \\sp { \\dagger } a _ { j } .", "caption_len": 35}, "5.png": {"img_path": "./data/small/images/images_test/5.png", "size": [141, 35], "caption": "\\, ^ { * } d ^ { * } H = \\kappa ^ { * } d \\phi = J _ { B } .", "caption_len": 28}, "6.png": {"img_path": "./data/small/images/images_test/6.png", "size": [373, 55], "caption": "{ \\frac { \\phi ^ { \\prime \\prime } } { A } } + { \\frac { 1 } { A } } \\left( - { \\frac { 1 } { 2 } } { \\frac { A ^ { \\prime } } { A } } + 2 { \\frac { B ^ { \\prime } } { B } } + { \\frac { 2 } { r } } \\right) \\phi ^ { \\prime } - { \\frac { 2 } { r ^ { 2 } } } \\phi - \\lambda \\phi ( \\phi ^ { 2 } - \\eta ^ { 2 } ) = 0 .", "caption_len": 115}, "7.png": {"img_path": "./data/small/images/images_test/7.png", "size": [152, 36], "caption": "\\partial _ { \\mu } ( F ^ { \\mu u } - e j ^ { \\mu } x ^ { u } ) = 0 .", "caption_len": 30}, "8.png": {"img_path": "./data/small/images/images_test/8.png", "size": [382, 63], "caption": "V _ { n s } ( { \\tilde { x } } ) = \\left( \\frac { { \\tilde { m } } N ^ { 2 } } { 1 6 \\pi } \\right) N g ^ { 2 n s - 1 } { \\tilde { x } } ^ { 2 } \\left\\{ { \\tilde { x } } ^ { 2 } - \\frac { 2 { \\tilde { b } } } { 3 } { \\tilde { x } } + \\frac { { \\tilde { b } } ^ { 2 } } { 3 } - ( - 1 ) ^ { n s } { \\tilde { c } } \\right\\} .", "caption_len": 124}, "9.png": {"img_path": "./data/small/images/images_test/9.png", "size": [284, 49], "caption": "g _ { i j } ( x ) = { \\frac { 1 } { a ^ { 2 } } } \\delta _ { i j } , \\phi ^ { a } ( x ) = \\phi ^ { a } , \\quad ( a , \\phi ^ { a } \\! : \\mathrm { c o n s t . } )", "caption_len": 68}, "10.png": {"img_path": "./data/small/images/images_test/10.png", "size": [185, 63], "caption": "\\rho _ { L } ( q ) = \\sum _ { m = 1 } ^ { L } \\ P _ { L } ( m ) \\ { \\frac { 1 } { q ^ { m - 1 } } } .", "caption_len": 48}, "11.png": {"img_path": "./data/small/images/images_test/11.png", "size": [145, 55], "caption": "e x p \\left( - \\frac { \\partial } { \\partial \\alpha _ { j } } \\theta ^ { j k } \\frac { \\partial } { \\partial \\alpha _ { k } } \\right)", "caption_len": 38}, "12.png": {"img_path": "./data/small/images/images_test/12.png", "size": [149, 36], "caption": "L _ { 0 } = \\Phi ( w ) = \\bigtriangleup \\Phi ( w ) ,", "caption_len": 19}, "13.png": {"img_path": "./data/small/images/images_test/13.png", "size": [143, 39], "caption": "\\left( D ^ { * } D ^ { * } + m ^ { 2 } \\right) { \\cal H } = 0", "caption_len": 26}, "14.png": {"img_path": "./data/small/images/images_test/14.png", "size": [98, 54], "caption": "{ \\frac { d V } { d \\Phi } } = - { \\frac { w \\Phi } { \\Phi _ { \\! _ { 0 } } ^ { 2 } } } .", "caption_len": 38}, "15.png": {"img_path": "./data/small/images/images_test/15.png", "size": [369, 49], "caption": "g ( z , \\bar { z } ) = - \\frac { 1 } { 2 } \\left[ x ( z , \\bar { z } ) s + x ^ { * } ( z , \\bar { z } ) s ^ { * } + u ^ { * } ( z , \\bar { z } ) t + u ( z , \\bar { z } ) t ^ { * } \\right] ,", "caption_len": 82}, "16.png": {"img_path": "./data/small/images/images_test/16.png", "size": [107, 37], "caption": "x _ { \\mu } ^ { c } = x _ { \\mu } + A _ { \\mu } .", "caption_len": 24}, "17.png": {"img_path": "./data/small/images/images_test/17.png", "size": [145, 57], "caption": "s = { \\frac { S } { V } } = { \\frac { A _ { H } } { l _ { p } ^ { 8 } V } } = { \\frac { T ^ { 2 } } { \\gamma } } .", "caption_len": 51}, "18.png": {"img_path": "./data/small/images/images_test/18.png", "size": [275, 55], "caption": "\\psi ( \\gamma ) = \\exp { - ( { \\textstyle { \\frac { g ^ { 2 } } { 2 } } } ) \\int _ { \\gamma } d y ^ { a } \\int _ { \\gamma } d y ^ { a ^ { \\prime } } D _ { 1 } ( y - y ^ { \\prime } ) }", "caption_len": 69}, "19.png": {"img_path": "./data/small/images/images_test/19.png", "size": [356, 55], "caption": "E = E _ { 0 } + \\frac { 1 } { 2 \\sinh ( \\gamma ( 0 ) / 2 ) } \\sinh \\left( \\gamma ( 0 ) \\left( \\frac { 1 } { 2 } + c ( 0 ) \\right) \\right) h c u _ { \\mathrm { v i b } }", "caption_len": 59}, "20.png": {"img_path": "./data/small/images/images_test/20.png", "size": [152, 52], "caption": "\\langle T _ { z z } \\rangle = - 3 \\times \\frac { \\pi ^ { 2 } } { 1 4 4 0 a ^ { 4 } } .", "caption_len": 34}, "21.png": {"img_path": "./data/small/images/images_test/21.png", "size": [292, 53], "caption": "\\partial _ { u } \\xi _ { z } ^ { ( 1 ) } + { \\frac { 1 } { u } } \\xi _ { z } ^ { ( 1 ) } = { \\frac { 1 } { ( \\pi T R ) ^ { 2 } u } } \\left[ C _ { z } H _ { z z } ^ { \\prime } + C _ { t } H _ { t z } ^ { \\prime } \\right] .", "caption_len": 92}, "22.png": {"img_path": "./data/small/images/images_test/22.png", "size": [356, 38], "caption": "S \\sim \\tilde { \\psi } Q _ { o } \\tilde { \\psi } + g _ { s } ^ { 1 / 2 } \\tilde { \\psi } ^ { 3 } + \\tilde { \\phi } Q _ { c } \\tilde { \\phi } + g _ { s } \\tilde { \\phi } ^ { 3 } + \\tilde { \\phi } B ( g _ { s } ^ { 1 / 2 } \\tilde { \\psi } ) + \\cdots .", "caption_len": 91}, "23.png": {"img_path": "./data/small/images/images_test/23.png", "size": [415, 63], "caption": "C ( x ^ { \\prime } , x ^ { \\prime \\prime } ) = C \\Phi ( x ^ { \\prime } , x ^ { \\prime \\prime } ) \\ , \\quad \\Phi ( x ^ { \\prime } , x ^ { \\prime \\prime } ) = \\exp \\left[ - i e \\int _ { x ^ { \\prime \\prime } } ^ { x ^ { \\prime } } d x ^ { \\mu } A _ { \\mu } ( x ) \\right] \\ ,", "caption_len": 93}, "24.png": {"img_path": "./data/small/images/images_test/24.png", "size": [308, 73], "caption": "\\tilde { \\alpha } = \\alpha \\beta ^ { - m } = \\left( \\begin{array} { c c c } { \\omega _ { k } ^ { - 2 y } \\omega _ { 2 d } ^ { 2 m } } & { 0 } & { 0 } \\\\ { 0 } & { \\omega _ { k } ^ { y } \\omega _ { 2 d } ^ { - m } } & { 0 } \\\\ { 0 } & { 0 } & { \\omega _ { k } ^ { y } \\omega _ { 2 d } ^ { - m } } \\\\ \\end{array} \\right)", "caption_len": 119}, "25.png": {"img_path": "./data/small/images/images_test/25.png", "size": [331, 38], "caption": "d s ^ { 2 } = H ^ { - 2 } f ( r ) d t ^ { 2 } + H ^ { 2 / ( n - 1 ) } ( f ( r ) ^ { - 1 } d r ^ { 2 } + r ^ { 2 } d \\Omega _ { n } ^ { 2 } ) ,", "caption_len": 71}, "26.png": {"img_path": "./data/small/images/images_test/26.png", "size": [283, 37], "caption": "y ^ { 2 } = \\rho \\cosh \\beta \\sin \\theta \\sin \\phi \\qquad \\qquad y ^ { 3 } = \\rho \\cos \\theta", "caption_len": 26}, "27.png": {"img_path": "./data/small/images/images_test/27.png", "size": [350, 39], "caption": "e ^ { A } = e ^ { A _ { 0 } } \\left( t _ { 0 } - \\mathrm { s i g n } ( m ) t \\right) ^ { - \\frac { m } { 2 } } , \\chi = \\chi _ { 0 } \\left( t _ { 0 } - \\mathrm { s i g n } ( m ) t \\right) ^ { m } ,", "caption_len": 79}, "28.png": {"img_path": "./data/small/images/images_test/28.png", "size": [282, 50], "caption": "\\gamma _ { j } { \\cal P } _ { j i } = \\frac { 4 } { 3 } \\{ [ A d T ] [ t _ { 8 } ^ { c } , [ t _ { 8 } ^ { c } , { \\gamma } _ { j } ] ] [ A d T ^ { - 1 } ] \\} { A d { \\hat { g } } } _ { i j } .", "caption_len": 88}, "29.png": {"img_path": "./data/small/images/images_test/29.png", "size": [97, 49], "caption": "K _ { \\mu u } = \\frac { 1 } { 2 } \\dot { g } _ { \\mu u } .", "caption_len": 26}} |
Oops, something went wrong.