Upload ReconResNet
Browse files- ReconResNet.py +25 -0
- ReconResNetConfig.py +37 -0
- config.json +26 -0
- model.safetensors +3 -0
ReconResNet.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import PreTrainedModel
|
2 |
+
from ReconResNetBase import ReconResNetBase
|
3 |
+
from ReconResNetConfig import ReconResNetConfig
|
4 |
+
|
5 |
+
class ReconResNet(PreTrainedModel):
|
6 |
+
config_class = ReconResNetConfig
|
7 |
+
def __init__(self, config):
|
8 |
+
super().__init__(config)
|
9 |
+
self.model = ReconResNetBase(
|
10 |
+
in_channels=config.in_channels,
|
11 |
+
out_channels=config.out_channels,
|
12 |
+
res_blocks=config.res_blocks,
|
13 |
+
starting_nfeatures=config.starting_nfeatures,
|
14 |
+
updown_blocks=config.updown_blocks,
|
15 |
+
is_relu_leaky=config.is_relu_leaky,
|
16 |
+
do_batchnorm=config.do_batchnorm,
|
17 |
+
res_drop_prob=config.res_drop_prob,
|
18 |
+
is_replicatepad=config.is_replicatepad,
|
19 |
+
out_act=config.out_act,
|
20 |
+
forwardV=config.forwardV,
|
21 |
+
upinterp_algo=config.upinterp_algo,
|
22 |
+
post_interp_convtrans=config.post_interp_convtrans,
|
23 |
+
is3D=config.is3D)
|
24 |
+
def forward(self, x):
|
25 |
+
return self.model(x)
|
ReconResNetConfig.py
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import PretrainedConfig
|
2 |
+
from typing import List
|
3 |
+
|
4 |
+
class ReconResNetConfig(PretrainedConfig):
|
5 |
+
model_type = "ReconResNet"
|
6 |
+
def __init__(
|
7 |
+
self,
|
8 |
+
in_channels=1,
|
9 |
+
out_channels=1,
|
10 |
+
res_blocks=14,
|
11 |
+
starting_nfeatures=64,
|
12 |
+
updown_blocks=2,
|
13 |
+
is_relu_leaky=True,
|
14 |
+
do_batchnorm=False,
|
15 |
+
res_drop_prob=0.2,
|
16 |
+
is_replicatepad=0,
|
17 |
+
out_act="sigmoid",
|
18 |
+
forwardV=0,
|
19 |
+
upinterp_algo='convtrans',
|
20 |
+
post_interp_convtrans=False,
|
21 |
+
is3D=False,
|
22 |
+
**kwargs):
|
23 |
+
self.in_channels = in_channels
|
24 |
+
self.out_channels = out_channels
|
25 |
+
self.res_blocks = res_blocks
|
26 |
+
self.starting_nfeatures = starting_nfeatures
|
27 |
+
self.updown_blocks = updown_blocks
|
28 |
+
self.is_relu_leaky = is_relu_leaky
|
29 |
+
self.do_batchnorm = do_batchnorm
|
30 |
+
self.res_drop_prob = res_drop_prob
|
31 |
+
self.is_replicatepad = is_replicatepad
|
32 |
+
self.out_act = out_act
|
33 |
+
self.forwardV = forwardV
|
34 |
+
self.upinterp_algo = upinterp_algo
|
35 |
+
self.post_interp_convtrans = post_interp_convtrans
|
36 |
+
self.is3D = is3D
|
37 |
+
super().__init__(**kwargs)
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"ReconResNet"
|
4 |
+
],
|
5 |
+
"auto_map": {
|
6 |
+
"AutoConfig": "ReconResNetConfig.ReconResNetConfig",
|
7 |
+
"AutoModel": "ReconResNet.ReconResNet"
|
8 |
+
},
|
9 |
+
"do_batchnorm": false,
|
10 |
+
"forwardV": 0,
|
11 |
+
"in_channels": 1,
|
12 |
+
"is3D": false,
|
13 |
+
"is_relu_leaky": true,
|
14 |
+
"is_replicatepad": 0,
|
15 |
+
"model_type": "ReconResNet",
|
16 |
+
"out_act": "sigmoid",
|
17 |
+
"out_channels": 1,
|
18 |
+
"post_interp_convtrans": false,
|
19 |
+
"res_blocks": 14,
|
20 |
+
"res_drop_prob": 0.2,
|
21 |
+
"starting_nfeatures": 64,
|
22 |
+
"torch_dtype": "float32",
|
23 |
+
"transformers_version": "4.44.2",
|
24 |
+
"updown_blocks": 2,
|
25 |
+
"upinterp_algo": "convtrans"
|
26 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b30255b8ecb23abc738ad0cf27e1bcbe469844f876611e2f2ac69b5600d02151
|
3 |
+
size 69075000
|