Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
deeplightfield
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Nianchen Deng
deeplightfield
Commits
3e1a5b04
Commit
3e1a5b04
authored
4 years ago
by
BobYeah
Browse files
Options
Downloads
Patches
Plain Diff
sync
parent
67c4de9e
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
msl_net.py
+45
-0
45 additions, 0 deletions
msl_net.py
run_lf_syn.py
+2
-2
2 additions, 2 deletions
run_lf_syn.py
with
47 additions
and
2 deletions
msl_net.py
0 → 100644
+
45
−
0
View file @
3e1a5b04
from
typing
import
List
import
torch
import
torch.nn
as
nn
from
.pytorch_prototyping.pytorch_prototyping
import
*
from
.my
import
util
from
.my
import
device
class
FcNet
(
nn
.
Module
):
def
__init__
(
self
,
in_chns
,
out_chns
,
nf
,
n_layers
):
super
().
__init__
()
self
.
layers
=
list
()
self
.
layers
.
append
(
nn
.
Linear
(
in_chns
,
nf
))
self
.
layers
.
append
(
nn
.
LeakyReLU
())
for
_
in
range
(
1
,
n_layers
):
self
.
layers
.
append
(
nn
.
Linear
(
nf
,
nf
))
self
.
layers
.
append
(
nn
.
LeakyReLU
())
self
.
layers
.
append
(
nn
.
Linear
(
nf
,
out_chns
))
self
.
net
=
nn
.
Sequential
(
*
self
.
layers
)
def
forward
(
self
,
x
):
return
self
.
net
(
x
)
class
Rendering
(
nn
.
Module
):
def
__init__
(
self
,
n_sphere_layers
):
super
().
__init__
()
self
.
n_sl
=
n_sphere_layers
def
forward
(
self
,
net
,
pos
,
dir
):
"""
[summary]
:param pos: B x 3, position of a ray
:param dir: B x 3, direction of a ray
"""
class
MslNet
(
nn
.
Module
):
def
__init__
(
self
):
super
().
__init__
()
def
forward
(
self
,
x
):
This diff is collapsed.
Click to expand it.
run_lf_syn.py
+
2
−
2
View file @
3e1a5b04
...
...
@@ -27,7 +27,7 @@ BATCH_SIZE = 8
TEST_BATCH_SIZE
=
10
NUM_EPOCH
=
1000
MODE
=
"
Silence
"
# "Perf"
EPOCH_BEGIN
=
0
EPOCH_BEGIN
=
60
0
def
train
():
...
...
@@ -58,7 +58,7 @@ def train():
# 3. Train
model
.
train
()
epoch
=
EPOCH_BEGIN
iters
=
EPOCH_BEGIN
*
len
(
train_data_loader
)
iters
=
EPOCH_BEGIN
*
len
(
train_data_loader
)
*
BATCH_SIZE
util
.
CreateDirIfNeed
(
RUN_DIR
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment