Runtime
TODO.
DefaultWorker
dataclass
#
DefaultWorker(
state: NePSState,
settings: WorkerSettings,
evaluation_fn: Callable[..., EvaluatePipelineReturn],
optimizer: AskFunction,
worker_id: str,
worker_cumulative_eval_count: int = 0,
worker_cumulative_eval_cost: float = 0.0,
worker_cumulative_evaluation_time_seconds: float = 0.0,
_GRACE: ClassVar = FS_SYNC_GRACE_BASE,
)
A default worker for the NePS system.
This is the worker that is used by default in the neps.run() loop.
evaluation_fn
instance-attribute
#
evaluation_fn: Callable[..., EvaluatePipelineReturn]
The evaluation function to use for the worker.
worker_cumulative_eval_cost
class-attribute
instance-attribute
#
worker_cumulative_eval_cost: float = 0.0
The cost of the evaluations done by this worker.
worker_cumulative_eval_count
class-attribute
instance-attribute
#
worker_cumulative_eval_count: int = 0
The number of evaluations done by this worker.
worker_cumulative_evaluation_time_seconds
class-attribute
instance-attribute
#
worker_cumulative_evaluation_time_seconds: float = 0.0
The time spent evaluating configurations by this worker.
new
classmethod
#
new(
*,
state: NePSState,
optimizer: AskFunction,
settings: WorkerSettings,
evaluation_fn: Callable[..., EvaluatePipelineReturn],
worker_id: str | None = None
) -> DefaultWorker
Create a new worker.
Source code in neps\runtime.py
run
#
Run the worker.
Will keep running until one of the criterion defined by the WorkerSettings
is met.
Source code in neps\runtime.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 |
|
get_in_progress_trial
#
get_in_progress_trial() -> Trial
Get the currently running trial in this process.
Source code in neps\runtime.py
get_workers_neps_state
#
get_workers_neps_state() -> NePSState
Get the worker's NePS state.