• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sisl / astra-rl / 16202936207

10 Jul 2025 06:22PM UTC coverage: 10.039%. Remained the same
16202936207

push

github

Jemoka
some renaming

- loose -> loss
- rollout -> environment

0 of 13 new or added lines in 4 files covered. (0.0%)

2 existing lines in 1 file now uncovered.

26 of 259 relevant lines covered (10.04%)

0.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/astra_rl/core/algorithm.py
1
"""
2
algorithm.py
3
"""
4

5
from abc import abstractmethod, ABC
×
6
from typing import Sequence, Generic
×
7

8
import torch
×
9

10
from astra_rl.core.problem import Problem
×
NEW
11
from astra_rl.core.environment import Graph
×
12
from astra_rl.core.common import Step, Batch, StateT, ActionT
×
13

14

15
class Algorithm(ABC, Generic[StateT, ActionT, Step, Batch]):
×
16
    def __init__(self, problem: Problem[StateT, ActionT]):
×
17
        self.problem = problem
×
18

19
    @abstractmethod
×
20
    def flatten(self, graph: Graph[StateT, ActionT]) -> Sequence[Step]:
×
21
        pass
×
22

23
    @abstractmethod
×
24
    @staticmethod
×
25
    def collate_fn(batch: Sequence[Step]) -> Batch:
×
26
        """the collate_fn for torch dataloaders for batching"""
27
        pass
×
28

29
    @abstractmethod
×
30
    def step(self, batch: Batch) -> torch.Tensor:
×
31
        """take a step and compute loss"""
32
        pass
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc