You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.py 2.6 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import fire
  2. import os
  3. import joblib
  4. import numpy as np
  5. import learnware
  6. from sklearn import svm
  7. from learnware.market import EasyMarket, BaseUserInfo
  8. from learnware.market import database_ops
  9. from learnware.learnware import Learnware
  10. import learnware.specification as specification
  11. from learnware.utils import get_module_by_module_path
  12. class LearnwareMarketWorkflow:
  13. curr_root = os.path.dirname(os.path.abspath(__file__))
  14. semantic_specs = [
  15. {
  16. "Data": {"Values": ["Tabular"], "Type": "Class"},
  17. "Task": {
  18. "Values": ["Classification"],
  19. "Type": "Class",
  20. },
  21. "Device": {"Values": ["GPU"], "Type": "Tag"},
  22. "Scenario": {"Values": ["Nature"], "Type": "Tag"},
  23. "Description": {"Values": "", "Type": "Description"},
  24. "Name": {"Values": "learnware_1", "Type": "Name"},
  25. },
  26. {
  27. "Data": {"Values": ["Tabular"], "Type": "Class"},
  28. "Task": {
  29. "Values": ["Classification"],
  30. "Type": "Class",
  31. },
  32. "Device": {"Values": ["GPU"], "Type": "Tag"},
  33. "Scenario": {"Values": ["Business", "Nature"], "Type": "Tag"},
  34. "Description": {"Values": "", "Type": "Description"},
  35. "Name": {"Values": "learnware_2", "Type": "Name"},
  36. },
  37. {
  38. "Data": {"Values": ["Tabular"], "Type": "Class"},
  39. "Task": {
  40. "Values": ["Classification"],
  41. "Type": "Class",
  42. },
  43. "Device": {"Values": ["GPU"], "Type": "Tag"},
  44. "Scenario": {"Values": ["Business"], "Type": "Tag"},
  45. "Description": {"Values": "", "Type": "Description"},
  46. "Name": {"Values": "learnware_3", "Type": "Name"},
  47. },
  48. ]
  49. user_senmantic = {
  50. "Data": {"Values": ["Tabular"], "Type": "Class"},
  51. "Task": {
  52. "Values": ["Classification"],
  53. "Type": "Class",
  54. },
  55. "Device": {"Values": ["GPU"], "Type": "Tag"},
  56. "Scenario": {"Values": ["Business"], "Type": "Tag"},
  57. "Description": {"Values": "", "Type": "Description"},
  58. "Name": {"Values": "", "Type": "Name"},
  59. }
  60. def _init_learnware_market(self):
  61. """initialize learnware market"""
  62. database_ops.clear_learnware_table()
  63. learnware.init()
  64. self.learnware_market = EasyMarket()
  65. def _generate_learnware_randomly(self):
  66. pass
  67. # def _
  68. if __name__ == "__main__":
  69. fire.Fire(LearnwareMarketWorkflow)

基于学件范式,全流程地支持学件上传、检测、组织、查搜、部署和复用等功能。同时,该仓库作为北冥坞系统的引擎,支撑北冥坞系统的核心功能。