You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we find that we want more control over what inputs are rescaled, then something like
classRescaleInputsbyInput(nn.Module):
def__init__(self, rescale_index, inputs_to_rescale=None):
super().__init__()
self.rescale_index=rescale_index# if inputs_to_rescale is None, then it assume all except the current one.ifinputs_to_rescaleisNone:
self.inputs_to_rescale=# generate all indices except the rescale_index one.else:
self.inputs_to_rescale=inputs_to_rescaledefforward(self, x):
rescale_scalar=1/x[self.rescale_index]
new_x=# multiple all indices in "inputs_to_rescale" by "rescale_scalar".returnnew_x
The text was updated successfully, but these errors were encountered:
If we find that we want more control over what inputs are rescaled, then something like
The text was updated successfully, but these errors were encountered: