Skip to content

Commit

Permalink
Fixed lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
HowWeiBin committed Apr 5, 2024
1 parent 3ecea51 commit fd574d5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/dos-align/dos-align.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
total_edos.append(e_dos)

total_edos = torch.vstack(total_edos)
total_edos = ((total_edos.T * normalization).T)
total_edos = (total_edos.T * normalization).T

print(f"The final shape of all the DOS in the dataset is: {list(total_edos.shape)}")

Expand Down Expand Up @@ -240,7 +240,8 @@ def edos_derivative(x, eigenenergies, normalization):
dfn_dos_E = (
torch.sum(
torch.exp(-0.5 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2)
* (-1 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2), dim=0
* (-1 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2),
dim=0,
)
* normalization
)
Expand Down Expand Up @@ -872,7 +873,7 @@ def train_model(model_to_train, fixed_DOS, structure_splines, spline_positions,
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Average Hartree Energy Reference
#
#

for i in total_edos_H[train_index]:
plt.plot(x_dos_H, i, color="C0", alpha=0.6)
Expand Down Expand Up @@ -905,5 +906,5 @@ def train_model(model_to_train, fixed_DOS, structure_splines, spline_positions,
plt.xlabel("Energy [eV]")
plt.ylabel("DOS")
print("The DOS alignment is better under the optimized energy reference")
print ("The difference will increase with more training epochs")
print("The difference will increase with more training epochs")
# %%

0 comments on commit fd574d5

Please sign in to comment.