Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pytorchjob
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engin Eren
Pytorchjob
Commits
f963a38d
Commit
f963a38d
authored
2 years ago
by
Engin Eren
Browse files
Options
Downloads
Patches
Plain Diff
now Fake-Fake-Fake combination
parent
07057ffb
No related branches found
No related tags found
1 merge request
!4
3crit peter
Pipeline
#4217724
passed
2 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wganHCAL.py
+3
-3
3 additions, 3 deletions
wganHCAL.py
with
3 additions
and
3 deletions
wganHCAL.py
+
3
−
3
View file @
f963a38d
...
@@ -63,7 +63,7 @@ def train(args, aD, aG, aGE, device, train_loader, optimizer_d, optimizer_g, epo
...
@@ -63,7 +63,7 @@ def train(args, aD, aG, aGE, device, train_loader, optimizer_d, optimizer_g, epo
optimizer_d
.
zero_grad
()
optimizer_d
.
zero_grad
()
## Get Real data
## Get Real data
real_dataECAL
=
dataE
.
to
(
device
).
unsqueeze
(
1
).
float
()
#
real_dataECAL = dataE.to(device).unsqueeze(1).float()
real_dataHCAL
=
dataH
.
to
(
device
).
unsqueeze
(
1
).
float
()
real_dataHCAL
=
dataH
.
to
(
device
).
unsqueeze
(
1
).
float
()
label
=
energy
.
to
(
device
).
float
()
label
=
energy
.
to
(
device
).
float
()
###
###
...
@@ -78,10 +78,10 @@ def train(args, aD, aG, aGE, device, train_loader, optimizer_d, optimizer_g, epo
...
@@ -78,10 +78,10 @@ def train(args, aD, aG, aGE, device, train_loader, optimizer_d, optimizer_g, epo
fake_dataHCAL
=
aG
(
z
,
label
,
fake_ecal
).
detach
()
## 48 x 30 x 30
fake_dataHCAL
=
aG
(
z
,
label
,
fake_ecal
).
detach
()
## 48 x 30 x 30
## Critic fwd pass on Real
## Critic fwd pass on Real
disc_real
=
aD
(
real_dataECAL
,
real_dataHCAL
,
label
)
disc_real
=
aD
(
fake_ecal
,
real_dataHCAL
,
label
)
## Calculate Gradient Penalty Term
## Calculate Gradient Penalty Term
gradient_penalty
=
calc_gradient_penalty
(
aD
,
real_dataECAL
,
real_dataHCAL
,
fake_dataHCAL
,
label
,
args
.
batch_size
,
device
,
layer
=
48
,
xsize
=
30
,
ysize
=
30
)
gradient_penalty
=
calc_gradient_penalty
(
aD
,
fake_ecal
,
real_dataHCAL
,
fake_dataHCAL
,
label
,
args
.
batch_size
,
device
,
layer
=
48
,
xsize
=
30
,
ysize
=
30
)
## Critic fwd pass on Fake HCAL
## Critic fwd pass on Fake HCAL
disc_fake
=
aD
(
fake_ecal
,
fake_dataHCAL
.
unsqueeze
(
1
),
label
)
disc_fake
=
aD
(
fake_ecal
,
fake_dataHCAL
.
unsqueeze
(
1
),
label
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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