fit_a_nef.nef.mfn.FourierNet
- class fit_a_nef.nef.mfn.FourierNet(output_dim: int, hidden_dim: int, num_filters: int, weight_scale: float = 6.0, input_scale: float = 256.0, parent: Union[Type[flax.linen.module.Module], flax.core.scope.Scope, Type[flax.linen.module._Sentinel], NoneType] = <flax.linen.module._Sentinel object at 0x7f8df69b2740>, name: Optional[str] = None)
- __init__(output_dim: int, hidden_dim: int, num_filters: int, weight_scale: float = 6.0, input_scale: float = 256.0, parent: ~typing.Type[~flax.linen.module.Module] | ~flax.core.scope.Scope | ~typing.Type[~flax.linen.module._Sentinel] | None = <flax.linen.module._Sentinel object>, name: str | None = None) None
Methods
__init__(output_dim, hidden_dim, num_filters)apply(variables, *args[, rngs, method, ...])Applies a module method to variables and returns output and modified variables.
bind(variables, *args[, rngs, mutable])Creates an interactive Module instance by binding variables and RNGs.
clone(*[, parent, _deep_clone, _reset_names])Creates a clone of this Module, with optionally updated arguments.
get_variable(col, name[, default])Retrieves the value of a Variable.
has_rng(name)Returns true if a PRNGSequence with name name exists.
has_variable(col, name)Checks if a variable of given collection and name exists in this Module.
init(rngs, *args[, method, mutable, ...])Initializes a module method with variables and returns modified variables.
init_with_output(rngs, *args[, method, ...])Initializes a module method with variables and returns output and modified variables.
is_initializing()Returns True if running under self.init(...) or nn.init(...)().
is_mutable_collection(col)Returns true if the collection col is mutable.
lazy_init(rngs, *args[, method, mutable])Initializes a module without computing on an actual input.
make_rng(name)Returns a new RNG key from a given RNG sequence for this Module.
param(name, init_fn, *init_args[, unbox])Declares and returns a parameter in this Module.
perturb(name, value[, collection])Add an zero-value variable ('perturbation') to the intermediate value.
put_variable(col, name, value)Updates the value of the given variable if it is mutable, or an error otherwise.
setup()Initializes a Module lazily (similar to a lazy
__init__).sow(col, name, value[, reduce_fn, init_fn])Stores a value in a collection.
tabulate(rngs, *args[, depth, ...])Creates a summary of the Module represented as a table.
unbind()Returns an unbound copy of a Module and its variables.
variable(col, name[, init_fn, unbox])Declares and returns a variable in this Module.
Attributes
input_scalenameparentpathscopevariablesReturns the variables in this module.
weight_scaleoutput_dimhidden_dimnum_filters- setup()
Initializes a Module lazily (similar to a lazy
__init__).setupis called once lazily on a module instance when a module is bound, immediately before any other methods like__call__are invoked, or before asetup-defined attribute on self is accessed.This can happen in three cases:
Immediately when invoking
apply(),init()orinit_and_output().Once the module is given a name by being assigned to an attribute of another module inside the other module’s
setupmethod (see__setattr__()):class MyModule(nn.Module): def setup(self): submodule = Conv(...) # Accessing `submodule` attributes does not yet work here. # The following line invokes `self.__setattr__`, which gives # `submodule` the name "conv1". self.conv1 = submodule # Accessing `submodule` attributes or methods is now safe and # either causes setup() to be called once.
Once a module is constructed inside a method wrapped with
compact(), immediately before another method is called orsetupdefined attribute is accessed.