Hyper-nn

Latest version: v0.2.2

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.2.2

Made it easier to create customized hypernets by removing embedding module + weight generator concepts from base hypernetwork.

Before:

python
class TorchHyperNetwork(nn.Module, HyperNetwork):
def __init__(
self,
target_network: nn.Module,
num_target_parameters: Optional[int] = None,
embedding_dim: int = 100,
num_embeddings: int = 3,
weight_chunk_dim: Optional[int] = None,
custom_embedding_module: Optional[nn.Module] = None,
custom_weight_generator: Optional[nn.Module] = None,
):


After:
python
class TorchHyperNetwork(nn.Module, HyperNetwork):
def __init__(
self,
target_network: nn.Module,
num_target_parameters: Optional[int] = None,
):

0.2.1

- fixes some functional wrapper bugs

0.2.0

- Refactored forward apis so they require minimal modifications to existing pipelines. This makes it easier to replace any `nn.Module` with a hypernetwork and use it almost exactly how the target is originally used
- Specifically, removed `inp` keyword and instead just takes in `*args, **kwargs`. In addition, to allow for specific `generate_params` keywords, an optional dict of arguments can be provided through `generate_params_kwargs`.

For standard usage:
`output = hypernetwork(inp=[inp]) old` -> `output = hypernetwork(inp) new`


For dynamic hypernetworks:
`output = dynamic_hypernetwork(inp, hidden_state=torch.zeros((1,32))) old` -> `output = dynamic_hypernetwork(inp, generate_params_kwargs=dict(hidden_state=torch.zeros((1,32)))) new`

0.1.3

- Added detailed documentation
- rearranged functions for better readability

0.1.2

- Jax hypernets had `has_aux=True` by default, when it should be false

0.1.1

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.