Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
commit_message: 'docs: deploy documentation from ${{ github.sha }}'

- name: Upload build artifacts
if: github.event_name == 'pull_request'
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
Comment on lines 66 to 70
with:
name: documentation
Expand Down
4 changes: 0 additions & 4 deletions dynvision/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ def setup(self, stage=None) -> None:
class CoreModel(TemporalBase, DtypeDeviceCoordinatorMixin):
"""Core neural network functionality with device coordination only."""

pass


class MonitoredModel(TemporalBase, MonitoringMixin, DtypeDeviceCoordinatorMixin):
"""Core neural network with monitoring, but no Lightning integration."""

pass
1 change: 0 additions & 1 deletion dynvision/base/coordination.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def _determine_dtype_from_parameters(self) -> torch.dtype:
logger.warning(
f"Error determining dtype from parameters: {e}. Defaulting to torch.float16."
)
pass
return torch.float16

def create_aligned_tensor(self, *args, **kwargs) -> torch.Tensor:
Expand Down
1 change: 0 additions & 1 deletion dynvision/base/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def get_storage_index(

def reset(self, input_shape: Optional[Tuple[int, ...]] = None) -> None:
"""Reset strategy state."""
pass


class CyclicStrategy(SamplingStrategy):
Expand Down
2 changes: 0 additions & 2 deletions dynvision/base/temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ def verify_initialization(self) -> None:

def reset(self, input_shape: Optional[Tuple[int, ...]] = None) -> None:
"""Reset the model state, in particular hidden states."""
pass

def compute_idle_initial_states(
self, batch_size: int, device: torch.device, dtype: torch.dtype
Expand Down Expand Up @@ -400,7 +399,6 @@ def _forward(

else:
logger.debug(f"No {operation} defined for {layer_name}. Skipping.")
pass

# if isinstance(x, torch.Tensor) and (~torch.isfinite(x)).any():
# logger.warning(
Expand Down
2 changes: 1 addition & 1 deletion dynvision/data/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""

import logging
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from typing import Any, Optional, Tuple
from collections import OrderedDict
import torch
import torch.jit
Expand Down
2 changes: 1 addition & 1 deletion dynvision/data/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from concurrent.futures import ThreadPoolExecutor
from functools import lru_cache
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast
from typing import Any, Callable, List, Optional, Tuple
import torchvision as tv
import torch
from torch.utils.data import Dataset
Expand Down
4 changes: 1 addition & 3 deletions dynvision/data/ffcv_dataloader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from typing import Any, Callable, List, Optional, Tuple, Union
from .ffcv_operations import ExtendDataTimeFFCV, ExtendLabelTimeFFCV
import torch
import torch.distributed
Expand All @@ -10,7 +10,6 @@
IntDecoder,
NDArrayDecoder,
RandomResizedCropRGBImageDecoder,
SimpleRGBImageDecoder,
)
from ffcv.loader import Loader, OrderOption
from ffcv.pipeline.operation import Operation
Expand All @@ -20,7 +19,6 @@
ToTensor,
ToTorchImage,
NormalizeImage,
RandomResizedCrop,
)

from dynvision.data.transforms import get_data_transform, get_target_transform
Expand Down
2 changes: 1 addition & 1 deletion dynvision/data/ffcv_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def main() -> None:
)

# Get writer configuration
data_sample = dataset[0][0]
dataset[0][0]

image_writer = RGBImageField(
write_mode=config.writer_mode,
Expand Down
3 changes: 1 addition & 2 deletions dynvision/data/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ def __getitem__(self, idx):
import torch.nn.functional as F
import numpy as np
from typing import Optional, Union, Tuple, Callable
import warnings
import logging
from dynvision.utils import str_to_bool, alias_kwargs, filter_kwargs
from dynvision.utils import str_to_bool, alias_kwargs

logger = logging.getLogger(__name__)

Expand Down
4 changes: 0 additions & 4 deletions dynvision/model_components/layer_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,12 @@ class Skip(ConnectionBase):
The skip connection module adds the input tensor (x) of an earlier layer to the output tensor (h) of a deeper layer.
"""

pass


class Feedback(ConnectionBase):
"""
The feedback connection module adds a hidden state (h) of a deeper layer to the input tensor (x) of an earlier layer.
"""

pass


if __name__ == "__main__":
input_shape = (3, 32, 32)
Expand Down
2 changes: 0 additions & 2 deletions dynvision/model_components/recurrence.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,6 @@ class DepthPointwiseConnection(DepthwiseSeparableConnection):
Implements a depth-pointwise convolution connection.
"""

pass


class PointDepthwiseConnection(DepthwiseSeparableConnection):
"""
Expand Down
6 changes: 0 additions & 6 deletions dynvision/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
from .alexnet import *
from .cordsnet import *
from .cornet_rt import *
from .dyrcnn import *
from .resnet import *
from .resnetx3 import *
1 change: 0 additions & 1 deletion dynvision/models/alexnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from dynvision.base import BaseModel
from typing import Optional, Tuple
from dynvision.model_components import (
InputAdaption,
RecurrentConnectedConv2d,
)

Expand Down
1 change: 0 additions & 1 deletion dynvision/models/cordsnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ def _define_architecture(self) -> None:

# Configuration arrays
channels = [64, 64, 64, 128, 128, 256, 256, 512, 512]
sizes = [56, 56, 28, 28, 14, 14, 7, 7]
strides = [1, 1, 2, 1, 2, 1, 2, 1]

# Layer 0: Input processing (no recurrence, no bias)
Expand Down
7 changes: 1 addition & 6 deletions dynvision/models/cornet_rt.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@
"""

import logging
from typing import Optional, Dict, Any, Tuple, Union, List
from typing import Optional, Any, Tuple

import torch
import torch.nn as nn
from torch.utils import model_zoo

from dynvision.models.dyrcnn import DyRCNN
from dynvision.utils import alias_kwargs, str_to_bool
from dynvision.model_components import (
InputAdaption,
RConv2d,
Skip,
)


Expand All @@ -31,8 +28,6 @@ class ZeroStateSentinel:
Operations check isinstance and treat it as additive identity.
"""

pass


__all__ = ["CorNetRT"]

Expand Down
2 changes: 1 addition & 1 deletion dynvision/models/dyrcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""

import logging
from typing import Optional, Union, Dict, Any, List, Tuple
from typing import Optional, Union, Any, List, Tuple

import torch
import torch.nn as nn
Expand Down
1 change: 0 additions & 1 deletion dynvision/models/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ def forward(

def reset(self, input_shape: Optional[Tuple[int, ...]] = None) -> None:
"""Reset model state."""
pass

def _determine_residual_timesteps(self, **kwargs) -> int:
"""Determine residual timesteps (none for ResNet)."""
Expand Down