-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unstructured Sedna Lifelong Learning Architecture #392
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a4b1069
Improve base model codes of unstructured lifelong learning, i.e., RFNet
luosiqi 5dce8ff
Add base class for all the algorithm modules of unstructured lifelong…
luosiqi c5cf783
Conduct code check and improve docs of unstructured lifelong learning
luosiqi 9b4bfcc
Modify docker image address of unstructured lifelong learning in Readme
luosiqi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add base class for all the algorithm modules of unstructured lifelong…
… learning Signed-off-by: SiqiLuo <1587295470@qq.com>
- Loading branch information
commit 5dce8ff69ef57765f5ac763dab584c5f0c0fb391
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
11 changes: 11 additions & 0 deletions
11
examples/lifelong_learning/robot_dog_delivery/RFNet/evaluate.py
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
34 changes: 34 additions & 0 deletions
34
lib/sedna/algorithms/seen_task_learning/inference_integration/base_inference_integrate.py
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,34 @@ | ||
""" | ||
Integrate the inference results of all related tasks | ||
""" | ||
|
||
from typing import List | ||
|
||
import numpy as np | ||
|
||
from ..artifact import Task | ||
|
||
|
||
class BaseInferenceIntegrate: | ||
""" | ||
Base class for default calculation algorithm for inference integration | ||
|
||
Parameters | ||
---------- | ||
models: All models used for sample inference | ||
""" | ||
|
||
def __init__(self, models: list, **kwargs): | ||
self.models = models | ||
|
||
def __call__(self, tasks: List[Task]): | ||
""" | ||
Parameters | ||
---------- | ||
tasks: All tasks with sample result | ||
|
||
Returns | ||
------- | ||
result: inference results for all the inference samples | ||
""" | ||
raise NotImplementedError |
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
62 changes: 0 additions & 62 deletions
62
lib/sedna/algorithms/seen_task_learning/inference_integration/inference_integrate_by_type.py
This file was deleted.
Oops, something went wrong.
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
30 changes: 30 additions & 0 deletions
30
lib/sedna/algorithms/seen_task_learning/task_allocation/base_task_allocation.py
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,30 @@ | ||
""" | ||
Mining tasks of inference sample base on task attribute extractor | ||
|
||
Parameters | ||
---------- | ||
samples : infer sample, see `sedna.datasources.BaseDataSource` for more detail. | ||
|
||
Returns | ||
------- | ||
allocations : tasks that assigned to each sample | ||
""" | ||
|
||
from sedna.datasources import BaseDataSource | ||
|
||
|
||
class BaseTaskAllocation: | ||
""" | ||
Base class of task allocation algorithm | ||
|
||
Parameters | ||
---------- | ||
task_extractor : Model or dict | ||
task extractor is used to predict target tasks | ||
""" | ||
|
||
def __init__(self, task_extractor, **kwargs): | ||
self.task_extractor = task_extractor | ||
|
||
def __call__(self, samples: BaseDataSource): | ||
raise NotImplementedError |
7 changes: 4 additions & 3 deletions
7
lib/sedna/algorithms/seen_task_learning/task_allocation/task_allocation_by_origin.py
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
28 changes: 0 additions & 28 deletions
28
lib/sedna/algorithms/seen_task_learning/task_allocation/task_allocation_default.py
This file was deleted.
Oops, something went wrong.
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
34 changes: 34 additions & 0 deletions
34
lib/sedna/algorithms/seen_task_learning/task_definition/base_task_definition.py
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,34 @@ | ||
""" | ||
Divide multiple tasks based on data | ||
|
||
Parameters | ||
---------- | ||
samples: Train data, see `sedna.datasources.BaseDataSource` for more detail. | ||
|
||
Returns | ||
------- | ||
tasks: All tasks based on training data. | ||
task_extractor: Model or dict with a method to predict target tasks | ||
""" | ||
|
||
from typing import List, Any, Tuple | ||
|
||
from sedna.datasources import BaseDataSource | ||
|
||
from ..artifact import Task | ||
|
||
|
||
class BaseTaskDefinition: | ||
""" | ||
Dividing datasets with all sorts of methods | ||
""" | ||
|
||
def __init__(self, **kwargs): | ||
raise NotImplementedError | ||
|
||
|
||
def __call__(self, | ||
samples: BaseDataSource) -> Tuple[List[Task], | ||
Any, | ||
BaseDataSource]: | ||
raise NotImplementedError |
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
28 changes: 28 additions & 0 deletions
28
...dna/algorithms/seen_task_learning/task_relation_discovery/base_task_relation_discovery.py
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,28 @@ | ||
""" | ||
Discover relationships between all tasks | ||
|
||
Parameters | ||
---------- | ||
tasks :all tasks form `task_definition` | ||
|
||
Returns | ||
------- | ||
task_groups : List of groups which including at least 1 task. | ||
""" | ||
|
||
from typing import List | ||
|
||
from ..artifact import Task, TaskGroup | ||
|
||
|
||
class BaseTaskRelationDiscover: | ||
""" | ||
Assume that each task is independent of each other | ||
""" | ||
|
||
def __init__(self, **kwargs): | ||
raise NotImplementedError | ||
|
||
def __call__(self, tasks: List[Task]) -> List[TaskGroup]: | ||
raise NotImplementedError | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base on -> based on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done