Skip to content

Refactoring - #5

Open
sonechiman wants to merge 9 commits into
kayamin:masterfrom
sonechiman:master
Open

Refactoring#5
sonechiman wants to merge 9 commits into
kayamin:masterfrom
sonechiman:master

Conversation

@sonechiman

Copy link
Copy Markdown

No description provided.

Comment thread .gitignore
# for this project
Image_check.ipynb
/snapshot
/cfp-snapshot

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一般的な.gitignoreを追加

Comment thread generate_image.py
end = start + args.batch_size
batch_image = torch.FloatTensor(images[start:end])
batch_pose_code = torch.FloatTensor(pose_code[start:end]) # Condition 付に使用
batch_pose_code = torch.FloatTensor(pose_code[start:end]) # Condition 付に使用

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8でコーディングスタイルの統一

Comment thread main.py
import pdb


# TODO: Use pytorch's dataloader

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

やらないといけないことは TODO:で書いておくと検索しやすい

Comment thread main.py
else:
if args.images_perID==0:
if args.multi_DRGAN and args.images_perID == 0:
print("Please specify -images-perID of your data to input to multi_DRGAN")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

わざわざnotにする必要はないです

Comment thread model/model.py


def create_convs(channel_num, n_last=320):
return [

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conv層を何度も使うので関数化

Comment thread model/model.py
return x


def weight_sum_feature(x, n):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

関数名はsnake case

Comment thread model/model.py
def __init__(self, Np, Nz, channel_num, multi=False, images_perID=None):
super(Generator, self).__init__()
self.features = []
self.multi_flag = multi

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よくつかうのでflagとして保持

Comment thread model/model.py
self.multi_flag = multi
self.Nf = 320
if self.multi_flag:
self.Nf += 1

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiのときは中間層の次元数を1追加

if isinstance(m, nn.Conv2d):
m.weight.data.normal_(0, 0.02)

elif isinstance(m, nn.Linear):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elifではなく or で一緒に

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant