Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optim-wip: Add descriptions and argument documentation to losses #831

Merged
merged 3 commits into from
May 15, 2022

Conversation

greentfrapp
Copy link

No description provided.

@greentfrapp greentfrapp changed the title Add descriptions and argument documentation to losses Optim-wip: Add descriptions and argument documentation to losses Dec 28, 2021

Args:
target (nn.Module): The layer to optimize for.
batch_index (int, optional): The index of the image to optimize if we
Copy link
Contributor

Choose a reason for hiding this comment

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

The batch_index documentation is missing Default: None below the description for all of the batch_index docs I think.

Copy link
Contributor

@ProGamerGov ProGamerGov Mar 1, 2022

Choose a reason for hiding this comment

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

I think that the batch index docs should look like this:

            batch_index (int, optional): The index of activations to optimize if
                optimizing a batch of activations. If set to None, defaults to all
                activations in the batch.
                Default: None

Comment on lines +253 to +258
x (int, optional): The x coordinate of the neuron to optimize for. If
unspecified, defaults to center, or one unit left of center for even
lengths.
y (int, optional): The y coordinate of the neuron to optimize for. If
unspecified, defaults to center, or one unit up of center for even
heights.
Copy link
Contributor

Choose a reason for hiding this comment

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

These docs are also missing Default: None.

Comment on lines +590 to +591
channel_index (int): The index of the channel to optimize for.
cossim_pow (float, optional): The desired cosine similarity power to use.
Copy link
Contributor

Choose a reason for hiding this comment

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

These docs are missing their Default settings.

Comment on lines +584 to +589
x (int, optional): The x coordinate of the neuron to optimize for. If
unspecified, defaults to center, or one unit left of center for even
lengths.
y (int, optional): The y coordinate of the neuron to optimize for. If
unspecified, defaults to center, or one unit up of center for even
heights.
Copy link
Contributor

Choose a reason for hiding this comment

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

These docs are missing Default: None.

Comment on lines +689 to +698
x (int, optional): The x coordinate of the neuron to optimize for. If
unspecified, defaults to center, or one unit left of center for even
lengths.
y (int, optional): The y coordinate of the neuron to optimize for. If
unspecified, defaults to center, or one unit up of center for even
heights.
wx (int, optional): Length of neurons to apply the weights to, along the
x-axis.
wy (int, optional): Length of neurons to apply the weights to, along the
y-axis.
Copy link
Contributor

Choose a reason for hiding this comment

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

These docs are all missing Default: None

Comment on lines +218 to +220
batch_index (int, optional): The index of the image to optimize if we
optimizing a batch of images. If unspecified, defaults to all images
in the batch.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we should be calling the activations images in the batch index docs, as the activations can be images, or 2D / 4D activations.

Copy link
Contributor

Choose a reason for hiding this comment

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

There's also a grammatical error in the batch_index docs: "optimize if we optimizing a batch of", should be "optimize if we are optimizing a batch of".

target (nn.Module): The layer to optimize for.
constant (float): Constant threshold to deduct from the activations.
Defaults to 0.
epsilon (float): Small value to add to L2 prior to sqrt. Defaults to 1e-6.
Copy link
Contributor

@ProGamerGov ProGamerGov Mar 1, 2022

Choose a reason for hiding this comment

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

I think the documentation format requires Default: <default_value> on a separate line. Defaults can still however be mentioned in the description.

Copy link
Contributor

Choose a reason for hiding this comment

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

The epsilon doc is also missing the optional word


Args:
target (nn.Module): The layer to optimize for.
constant (float): Constant threshold to deduct from the activations.
Copy link
Contributor

Choose a reason for hiding this comment

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

The doc should be listed as optional, as there is a default value: constant (float, optional)

@NarineK
Copy link
Contributor

NarineK commented May 15, 2022

@ProGamerGov, @greentfrapp, I'm thinking to merge this first since it only contains docs and I don't see any merge conflicts.

@ProGamerGov
Copy link
Contributor

@NarineK Yeah, lets do that!

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

Successfully merging this pull request may close these issues.

4 participants