Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
B
Basedformer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Basedformer
Commits
dcd0bba5
Commit
dcd0bba5
authored
Jun 17, 2022
by
Arda Cihaner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
8939ff4f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
__init__.py
__init__.py
+0
-0
basedformer/models/resnet.py
basedformer/models/resnet.py
+4
-4
basedformer/models/vit.py
basedformer/models/vit.py
+1
-1
No files found.
__init__.py
0 → 100644
View file @
dcd0bba5
basedformer/models/resnet.py
View file @
dcd0bba5
...
@@ -72,11 +72,11 @@ class ResNet(base_image.BaseVisionModel):
...
@@ -72,11 +72,11 @@ class ResNet(base_image.BaseVisionModel):
nn
.
ReLU
()
nn
.
ReLU
()
)
)
self
.
resblocks
=
nn
.
ModuleList
()
self
.
resblocks
=
nn
.
ModuleList
()
network_config
=
network_config_dict
[
self
.
config
.
network_layers
]
self
.
network_config
=
network_config_dict
[
self
.
config
.
network_size
]
is_bottleneck
=
network_config
[
0
]
is_bottleneck
=
self
.
network_config
[
0
]
curr_chan
=
64
curr_chan
=
64
prev_chan
=
curr_chan
prev_chan
=
curr_chan
for
i
in
network_config
[
1
]:
for
i
in
self
.
network_config
[
1
]:
for
_
in
range
(
i
):
for
_
in
range
(
i
):
resblock
=
ResBlockBottleNeck
(
prev_chan
,
curr_chan
)
if
is_bottleneck
else
ResBlock
(
prev_chan
,
curr_chan
)
resblock
=
ResBlockBottleNeck
(
prev_chan
,
curr_chan
)
if
is_bottleneck
else
ResBlock
(
prev_chan
,
curr_chan
)
self
.
resblocks
.
append
(
resblock
)
self
.
resblocks
.
append
(
resblock
)
...
@@ -84,7 +84,7 @@ class ResNet(base_image.BaseVisionModel):
...
@@ -84,7 +84,7 @@ class ResNet(base_image.BaseVisionModel):
curr_chan
*=
2
curr_chan
*=
2
self
.
avgpool
=
nn
.
AdaptiveAvgPool2d
((
1
,
1
))
self
.
avgpool
=
nn
.
AdaptiveAvgPool2d
((
1
,
1
))
self
.
fc
=
nn
.
Linear
(
prev_chan
,
self
.
config
.
out_size
)
self
.
fc
=
nn
.
Linear
(
prev_chan
,
self
.
config
.
n_class
)
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
out
=
self
.
layerin
(
x
)
out
=
self
.
layerin
(
x
)
...
...
basedformer/models/vit.py
View file @
dcd0bba5
...
@@ -124,7 +124,7 @@ class VisionTransformer(base_image.BaseVisionModel):
...
@@ -124,7 +124,7 @@ class VisionTransformer(base_image.BaseVisionModel):
'patch_size'
:
16
,
'patch_size'
:
16
,
'hidden_dim'
:
768
,
'hidden_dim'
:
768
,
'n_classes'
:
1000
,
'n_classes'
:
1000
,
'activation'
:
F
.
gelu
,
'activation'
:
torch
.
nn
.
GELU
()
,
'image_size'
:
(
224
,
224
),
'image_size'
:
(
224
,
224
),
'eps'
:
1e-5
,
'eps'
:
1e-5
,
'device'
:
torch
.
device
(
'cpu'
),
'device'
:
torch
.
device
(
'cpu'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment