forked from deepmodeling/dpgen2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: zjgemi <liuxin_zijian@163.com>
- Loading branch information
Showing
12 changed files
with
788 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import copy | ||
import logging | ||
import random | ||
from typing import ( | ||
List, | ||
Optional, | ||
) | ||
|
||
import numpy as np | ||
|
||
from .task import ( | ||
ExplorationTask, | ||
) | ||
from .task_group import ( | ||
ExplorationTaskGroup, | ||
) | ||
|
||
|
||
class DiffCSPTaskGroup(ExplorationTaskGroup): | ||
def __init__( | ||
self, | ||
trj_freq: int = 10, | ||
fmax: float = 1e-4, | ||
steps: int = 200, | ||
timeout: Optional[int] = None, | ||
): | ||
super().__init__() | ||
self.trj_freq = trj_freq | ||
self.fmax = fmax | ||
self.steps = steps | ||
self.timeout = timeout | ||
|
||
def make_task(self) -> 'DiffCSPTaskGroup': | ||
""" | ||
Make the DiffCSP task group. | ||
Returns | ||
------- | ||
task_grp: DiffCSPTaskGroup | ||
Return one DiffCSP task group. | ||
""" | ||
# clear all existing tasks | ||
self.clear() | ||
self.add_task(self._make_diffcsp_task()) | ||
return self | ||
|
||
def _make_diffcsp_task(self) -> ExplorationTask: | ||
task = ExplorationTask() | ||
task.trj_freq = self.trj_freq | ||
task.fmax = self.fmax | ||
task.steps = self.steps | ||
task.timeout = self.timeout | ||
return task |
Oops, something went wrong.