@epfml/discojs 2.0.0 → 2.1.2-p20240506085037.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/dist/aggregator/base.d.ts +180 -0
  2. package/dist/aggregator/base.js +236 -0
  3. package/dist/aggregator/get.d.ts +16 -0
  4. package/dist/aggregator/get.js +31 -0
  5. package/dist/aggregator/index.d.ts +7 -0
  6. package/dist/aggregator/index.js +4 -0
  7. package/dist/aggregator/mean.d.ts +23 -0
  8. package/dist/aggregator/mean.js +69 -0
  9. package/dist/aggregator/secure.d.ts +27 -0
  10. package/dist/aggregator/secure.js +91 -0
  11. package/dist/async_informant.d.ts +15 -0
  12. package/dist/async_informant.js +42 -0
  13. package/dist/client/base.d.ts +76 -0
  14. package/dist/client/base.js +88 -0
  15. package/dist/client/decentralized/base.d.ts +32 -0
  16. package/dist/client/decentralized/base.js +192 -0
  17. package/dist/client/decentralized/index.d.ts +2 -0
  18. package/dist/client/decentralized/index.js +2 -0
  19. package/dist/client/decentralized/messages.d.ts +28 -0
  20. package/dist/client/decentralized/messages.js +44 -0
  21. package/dist/client/decentralized/peer.d.ts +40 -0
  22. package/dist/client/decentralized/peer.js +189 -0
  23. package/dist/client/decentralized/peer_pool.d.ts +12 -0
  24. package/dist/client/decentralized/peer_pool.js +44 -0
  25. package/dist/client/event_connection.d.ts +34 -0
  26. package/dist/client/event_connection.js +105 -0
  27. package/dist/client/federated/base.d.ts +54 -0
  28. package/dist/client/federated/base.js +151 -0
  29. package/dist/client/federated/index.d.ts +2 -0
  30. package/dist/client/federated/index.js +2 -0
  31. package/dist/client/federated/messages.d.ts +30 -0
  32. package/dist/client/federated/messages.js +24 -0
  33. package/dist/client/index.d.ts +8 -0
  34. package/dist/client/index.js +8 -0
  35. package/dist/client/local.d.ts +3 -0
  36. package/dist/client/local.js +3 -0
  37. package/dist/client/messages.d.ts +30 -0
  38. package/dist/client/messages.js +26 -0
  39. package/dist/client/types.d.ts +2 -0
  40. package/dist/client/types.js +4 -0
  41. package/dist/client/utils.d.ts +2 -0
  42. package/dist/client/utils.js +7 -0
  43. package/dist/dataset/data/data.d.ts +48 -0
  44. package/dist/dataset/data/data.js +72 -0
  45. package/dist/dataset/data/data_split.d.ts +8 -0
  46. package/dist/dataset/data/data_split.js +1 -0
  47. package/dist/dataset/data/image_data.d.ts +11 -0
  48. package/dist/dataset/data/image_data.js +38 -0
  49. package/dist/dataset/data/index.d.ts +6 -0
  50. package/dist/dataset/data/index.js +5 -0
  51. package/dist/dataset/data/preprocessing/base.d.ts +16 -0
  52. package/dist/dataset/data/preprocessing/base.js +1 -0
  53. package/dist/dataset/data/preprocessing/image_preprocessing.d.ts +13 -0
  54. package/dist/dataset/data/preprocessing/image_preprocessing.js +40 -0
  55. package/dist/dataset/data/preprocessing/index.d.ts +4 -0
  56. package/dist/dataset/data/preprocessing/index.js +3 -0
  57. package/dist/dataset/data/preprocessing/tabular_preprocessing.d.ts +13 -0
  58. package/dist/dataset/data/preprocessing/tabular_preprocessing.js +45 -0
  59. package/dist/dataset/data/preprocessing/text_preprocessing.d.ts +13 -0
  60. package/dist/dataset/data/preprocessing/text_preprocessing.js +85 -0
  61. package/dist/dataset/data/tabular_data.d.ts +11 -0
  62. package/dist/dataset/data/tabular_data.js +25 -0
  63. package/dist/dataset/data/text_data.d.ts +11 -0
  64. package/dist/dataset/data/text_data.js +14 -0
  65. package/dist/{core/dataset → dataset}/data_loader/data_loader.d.ts +3 -5
  66. package/dist/dataset/data_loader/data_loader.js +2 -0
  67. package/dist/dataset/data_loader/image_loader.d.ts +20 -3
  68. package/dist/dataset/data_loader/image_loader.js +98 -23
  69. package/dist/dataset/data_loader/index.d.ts +5 -2
  70. package/dist/dataset/data_loader/index.js +4 -7
  71. package/dist/dataset/data_loader/tabular_loader.d.ts +34 -3
  72. package/dist/dataset/data_loader/tabular_loader.js +75 -15
  73. package/dist/dataset/data_loader/text_loader.d.ts +14 -0
  74. package/dist/dataset/data_loader/text_loader.js +25 -0
  75. package/dist/dataset/dataset.d.ts +5 -0
  76. package/dist/dataset/dataset.js +1 -0
  77. package/dist/dataset/dataset_builder.d.ts +60 -0
  78. package/dist/dataset/dataset_builder.js +142 -0
  79. package/dist/dataset/index.d.ts +5 -0
  80. package/dist/dataset/index.js +3 -0
  81. package/dist/default_tasks/cifar10/index.d.ts +2 -0
  82. package/dist/default_tasks/cifar10/index.js +60 -0
  83. package/dist/default_tasks/cifar10/model.d.ts +434 -0
  84. package/dist/default_tasks/cifar10/model.js +2385 -0
  85. package/dist/default_tasks/geotags/index.d.ts +2 -0
  86. package/dist/default_tasks/geotags/index.js +65 -0
  87. package/dist/default_tasks/geotags/model.d.ts +593 -0
  88. package/dist/default_tasks/geotags/model.js +4715 -0
  89. package/dist/default_tasks/index.d.ts +8 -0
  90. package/dist/default_tasks/index.js +8 -0
  91. package/dist/default_tasks/lus_covid.d.ts +2 -0
  92. package/dist/default_tasks/lus_covid.js +89 -0
  93. package/dist/default_tasks/mnist.d.ts +2 -0
  94. package/dist/default_tasks/mnist.js +61 -0
  95. package/dist/default_tasks/simple_face/index.d.ts +2 -0
  96. package/dist/default_tasks/simple_face/index.js +48 -0
  97. package/dist/default_tasks/simple_face/model.d.ts +513 -0
  98. package/dist/default_tasks/simple_face/model.js +4301 -0
  99. package/dist/default_tasks/skin_mnist.d.ts +2 -0
  100. package/dist/default_tasks/skin_mnist.js +80 -0
  101. package/dist/default_tasks/titanic.d.ts +2 -0
  102. package/dist/default_tasks/titanic.js +88 -0
  103. package/dist/default_tasks/wikitext.d.ts +2 -0
  104. package/dist/default_tasks/wikitext.js +38 -0
  105. package/dist/index.d.ts +18 -2
  106. package/dist/index.js +18 -6
  107. package/dist/{core/informant → informant}/graph_informant.d.ts +1 -1
  108. package/dist/informant/graph_informant.js +20 -0
  109. package/dist/informant/index.d.ts +1 -0
  110. package/dist/informant/index.js +1 -0
  111. package/dist/{core/logging → logging}/console_logger.d.ts +2 -2
  112. package/dist/logging/console_logger.js +22 -0
  113. package/dist/logging/index.d.ts +2 -0
  114. package/dist/logging/index.js +1 -0
  115. package/dist/{core/logging → logging}/logger.d.ts +3 -3
  116. package/dist/logging/logger.js +1 -0
  117. package/dist/memory/base.d.ts +119 -0
  118. package/dist/memory/base.js +9 -0
  119. package/dist/memory/empty.d.ts +20 -0
  120. package/dist/memory/empty.js +43 -0
  121. package/dist/memory/index.d.ts +3 -1
  122. package/dist/memory/index.js +3 -5
  123. package/dist/memory/model_type.d.ts +9 -0
  124. package/dist/memory/model_type.js +10 -0
  125. package/dist/{core/privacy.d.ts → privacy.d.ts} +1 -1
  126. package/dist/{core/privacy.js → privacy.js} +11 -16
  127. package/dist/serialization/index.d.ts +2 -0
  128. package/dist/serialization/index.js +2 -0
  129. package/dist/serialization/model.d.ts +5 -0
  130. package/dist/serialization/model.js +67 -0
  131. package/dist/{core/serialization → serialization}/weights.d.ts +2 -2
  132. package/dist/serialization/weights.js +37 -0
  133. package/dist/task/data_example.js +14 -0
  134. package/dist/task/digest.d.ts +5 -0
  135. package/dist/task/digest.js +14 -0
  136. package/dist/{core/task → task}/display_information.d.ts +5 -3
  137. package/dist/task/display_information.js +46 -0
  138. package/dist/task/index.d.ts +7 -0
  139. package/dist/task/index.js +5 -0
  140. package/dist/task/label_type.d.ts +9 -0
  141. package/dist/task/label_type.js +28 -0
  142. package/dist/task/summary.js +13 -0
  143. package/dist/task/task.d.ts +12 -0
  144. package/dist/task/task.js +22 -0
  145. package/dist/task/task_handler.d.ts +5 -0
  146. package/dist/task/task_handler.js +20 -0
  147. package/dist/task/task_provider.d.ts +5 -0
  148. package/dist/task/task_provider.js +1 -0
  149. package/dist/{core/task → task}/training_information.d.ts +9 -10
  150. package/dist/task/training_information.js +88 -0
  151. package/dist/training/disco.d.ts +40 -0
  152. package/dist/training/disco.js +107 -0
  153. package/dist/training/index.d.ts +2 -0
  154. package/dist/training/index.js +1 -0
  155. package/dist/training/trainer/distributed_trainer.d.ts +20 -0
  156. package/dist/training/trainer/distributed_trainer.js +36 -0
  157. package/dist/training/trainer/local_trainer.d.ts +12 -0
  158. package/dist/training/trainer/local_trainer.js +19 -0
  159. package/dist/training/trainer/trainer.d.ts +33 -0
  160. package/dist/training/trainer/trainer.js +52 -0
  161. package/dist/{core/training → training}/trainer/trainer_builder.d.ts +5 -7
  162. package/dist/training/trainer/trainer_builder.js +43 -0
  163. package/dist/types.d.ts +8 -0
  164. package/dist/types.js +1 -0
  165. package/dist/utils/event_emitter.d.ts +40 -0
  166. package/dist/utils/event_emitter.js +57 -0
  167. package/dist/validation/index.d.ts +1 -0
  168. package/dist/validation/index.js +1 -0
  169. package/dist/validation/validator.d.ts +28 -0
  170. package/dist/validation/validator.js +132 -0
  171. package/dist/weights/aggregation.d.ts +21 -0
  172. package/dist/weights/aggregation.js +44 -0
  173. package/dist/weights/index.d.ts +2 -0
  174. package/dist/weights/index.js +2 -0
  175. package/dist/weights/weights_container.d.ts +68 -0
  176. package/dist/weights/weights_container.js +96 -0
  177. package/package.json +25 -16
  178. package/README.md +0 -53
  179. package/dist/core/async_buffer.d.ts +0 -41
  180. package/dist/core/async_buffer.js +0 -97
  181. package/dist/core/async_informant.d.ts +0 -20
  182. package/dist/core/async_informant.js +0 -69
  183. package/dist/core/client/base.d.ts +0 -33
  184. package/dist/core/client/base.js +0 -35
  185. package/dist/core/client/decentralized/base.d.ts +0 -32
  186. package/dist/core/client/decentralized/base.js +0 -212
  187. package/dist/core/client/decentralized/clear_text.d.ts +0 -14
  188. package/dist/core/client/decentralized/clear_text.js +0 -96
  189. package/dist/core/client/decentralized/index.d.ts +0 -4
  190. package/dist/core/client/decentralized/index.js +0 -9
  191. package/dist/core/client/decentralized/messages.d.ts +0 -41
  192. package/dist/core/client/decentralized/messages.js +0 -54
  193. package/dist/core/client/decentralized/peer.d.ts +0 -26
  194. package/dist/core/client/decentralized/peer.js +0 -210
  195. package/dist/core/client/decentralized/peer_pool.d.ts +0 -14
  196. package/dist/core/client/decentralized/peer_pool.js +0 -92
  197. package/dist/core/client/decentralized/sec_agg.d.ts +0 -22
  198. package/dist/core/client/decentralized/sec_agg.js +0 -190
  199. package/dist/core/client/decentralized/secret_shares.d.ts +0 -3
  200. package/dist/core/client/decentralized/secret_shares.js +0 -39
  201. package/dist/core/client/decentralized/types.d.ts +0 -2
  202. package/dist/core/client/decentralized/types.js +0 -7
  203. package/dist/core/client/event_connection.d.ts +0 -37
  204. package/dist/core/client/event_connection.js +0 -158
  205. package/dist/core/client/federated/client.d.ts +0 -37
  206. package/dist/core/client/federated/client.js +0 -273
  207. package/dist/core/client/federated/index.d.ts +0 -2
  208. package/dist/core/client/federated/index.js +0 -7
  209. package/dist/core/client/federated/messages.d.ts +0 -38
  210. package/dist/core/client/federated/messages.js +0 -25
  211. package/dist/core/client/index.d.ts +0 -5
  212. package/dist/core/client/index.js +0 -11
  213. package/dist/core/client/local.d.ts +0 -8
  214. package/dist/core/client/local.js +0 -36
  215. package/dist/core/client/messages.d.ts +0 -28
  216. package/dist/core/client/messages.js +0 -33
  217. package/dist/core/client/utils.d.ts +0 -2
  218. package/dist/core/client/utils.js +0 -19
  219. package/dist/core/dataset/data/data.d.ts +0 -11
  220. package/dist/core/dataset/data/data.js +0 -20
  221. package/dist/core/dataset/data/data_split.d.ts +0 -5
  222. package/dist/core/dataset/data/data_split.js +0 -2
  223. package/dist/core/dataset/data/image_data.d.ts +0 -8
  224. package/dist/core/dataset/data/image_data.js +0 -64
  225. package/dist/core/dataset/data/index.d.ts +0 -5
  226. package/dist/core/dataset/data/index.js +0 -11
  227. package/dist/core/dataset/data/preprocessing.d.ts +0 -13
  228. package/dist/core/dataset/data/preprocessing.js +0 -33
  229. package/dist/core/dataset/data/tabular_data.d.ts +0 -8
  230. package/dist/core/dataset/data/tabular_data.js +0 -40
  231. package/dist/core/dataset/data_loader/data_loader.js +0 -10
  232. package/dist/core/dataset/data_loader/image_loader.d.ts +0 -17
  233. package/dist/core/dataset/data_loader/image_loader.js +0 -141
  234. package/dist/core/dataset/data_loader/index.d.ts +0 -3
  235. package/dist/core/dataset/data_loader/index.js +0 -9
  236. package/dist/core/dataset/data_loader/tabular_loader.d.ts +0 -29
  237. package/dist/core/dataset/data_loader/tabular_loader.js +0 -101
  238. package/dist/core/dataset/dataset.d.ts +0 -2
  239. package/dist/core/dataset/dataset.js +0 -2
  240. package/dist/core/dataset/dataset_builder.d.ts +0 -18
  241. package/dist/core/dataset/dataset_builder.js +0 -96
  242. package/dist/core/dataset/index.d.ts +0 -4
  243. package/dist/core/dataset/index.js +0 -14
  244. package/dist/core/index.d.ts +0 -18
  245. package/dist/core/index.js +0 -41
  246. package/dist/core/informant/graph_informant.js +0 -23
  247. package/dist/core/informant/index.d.ts +0 -3
  248. package/dist/core/informant/index.js +0 -9
  249. package/dist/core/informant/training_informant/base.d.ts +0 -31
  250. package/dist/core/informant/training_informant/base.js +0 -83
  251. package/dist/core/informant/training_informant/decentralized.d.ts +0 -5
  252. package/dist/core/informant/training_informant/decentralized.js +0 -22
  253. package/dist/core/informant/training_informant/federated.d.ts +0 -14
  254. package/dist/core/informant/training_informant/federated.js +0 -32
  255. package/dist/core/informant/training_informant/index.d.ts +0 -4
  256. package/dist/core/informant/training_informant/index.js +0 -11
  257. package/dist/core/informant/training_informant/local.d.ts +0 -6
  258. package/dist/core/informant/training_informant/local.js +0 -20
  259. package/dist/core/logging/console_logger.js +0 -33
  260. package/dist/core/logging/index.d.ts +0 -3
  261. package/dist/core/logging/index.js +0 -9
  262. package/dist/core/logging/logger.js +0 -9
  263. package/dist/core/logging/trainer_logger.d.ts +0 -24
  264. package/dist/core/logging/trainer_logger.js +0 -59
  265. package/dist/core/memory/base.d.ts +0 -22
  266. package/dist/core/memory/base.js +0 -9
  267. package/dist/core/memory/empty.d.ts +0 -14
  268. package/dist/core/memory/empty.js +0 -75
  269. package/dist/core/memory/index.d.ts +0 -3
  270. package/dist/core/memory/index.js +0 -9
  271. package/dist/core/memory/model_type.d.ts +0 -4
  272. package/dist/core/memory/model_type.js +0 -9
  273. package/dist/core/serialization/index.d.ts +0 -2
  274. package/dist/core/serialization/index.js +0 -6
  275. package/dist/core/serialization/model.d.ts +0 -5
  276. package/dist/core/serialization/model.js +0 -55
  277. package/dist/core/serialization/weights.js +0 -64
  278. package/dist/core/task/data_example.js +0 -24
  279. package/dist/core/task/display_information.js +0 -49
  280. package/dist/core/task/index.d.ts +0 -3
  281. package/dist/core/task/index.js +0 -8
  282. package/dist/core/task/model_compile_data.d.ts +0 -6
  283. package/dist/core/task/model_compile_data.js +0 -22
  284. package/dist/core/task/summary.js +0 -19
  285. package/dist/core/task/task.d.ts +0 -10
  286. package/dist/core/task/task.js +0 -31
  287. package/dist/core/task/training_information.js +0 -66
  288. package/dist/core/tasks/cifar10.d.ts +0 -3
  289. package/dist/core/tasks/cifar10.js +0 -65
  290. package/dist/core/tasks/geotags.d.ts +0 -3
  291. package/dist/core/tasks/geotags.js +0 -67
  292. package/dist/core/tasks/index.d.ts +0 -6
  293. package/dist/core/tasks/index.js +0 -10
  294. package/dist/core/tasks/lus_covid.d.ts +0 -3
  295. package/dist/core/tasks/lus_covid.js +0 -87
  296. package/dist/core/tasks/mnist.d.ts +0 -3
  297. package/dist/core/tasks/mnist.js +0 -60
  298. package/dist/core/tasks/simple_face.d.ts +0 -2
  299. package/dist/core/tasks/simple_face.js +0 -41
  300. package/dist/core/tasks/titanic.d.ts +0 -3
  301. package/dist/core/tasks/titanic.js +0 -88
  302. package/dist/core/training/disco.d.ts +0 -23
  303. package/dist/core/training/disco.js +0 -130
  304. package/dist/core/training/index.d.ts +0 -2
  305. package/dist/core/training/index.js +0 -7
  306. package/dist/core/training/trainer/distributed_trainer.d.ts +0 -20
  307. package/dist/core/training/trainer/distributed_trainer.js +0 -65
  308. package/dist/core/training/trainer/local_trainer.d.ts +0 -11
  309. package/dist/core/training/trainer/local_trainer.js +0 -34
  310. package/dist/core/training/trainer/round_tracker.d.ts +0 -30
  311. package/dist/core/training/trainer/round_tracker.js +0 -47
  312. package/dist/core/training/trainer/trainer.d.ts +0 -65
  313. package/dist/core/training/trainer/trainer.js +0 -160
  314. package/dist/core/training/trainer/trainer_builder.js +0 -95
  315. package/dist/core/training/training_schemes.d.ts +0 -5
  316. package/dist/core/training/training_schemes.js +0 -10
  317. package/dist/core/types.d.ts +0 -4
  318. package/dist/core/types.js +0 -2
  319. package/dist/core/validation/index.d.ts +0 -1
  320. package/dist/core/validation/index.js +0 -5
  321. package/dist/core/validation/validator.d.ts +0 -17
  322. package/dist/core/validation/validator.js +0 -104
  323. package/dist/core/weights/aggregation.d.ts +0 -8
  324. package/dist/core/weights/aggregation.js +0 -96
  325. package/dist/core/weights/index.d.ts +0 -2
  326. package/dist/core/weights/index.js +0 -7
  327. package/dist/core/weights/weights_container.d.ts +0 -19
  328. package/dist/core/weights/weights_container.js +0 -64
  329. package/dist/imports.d.ts +0 -2
  330. package/dist/imports.js +0 -7
  331. package/dist/memory/memory.d.ts +0 -26
  332. package/dist/memory/memory.js +0 -160
  333. package/dist/{core/task → task}/data_example.d.ts +1 -1
  334. package/dist/{core/task → task}/summary.d.ts +1 -1
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decode = exports.encode = exports.isEncoded = void 0;
4
- var tslib_1 = require("tslib");
5
- var msgpack = (0, tslib_1.__importStar)(require("msgpack-lite"));
6
- var __1 = require("..");
7
- function isSerialized(raw) {
8
- if (typeof raw !== 'object' || raw === null) {
9
- return false;
10
- }
11
- if (!('shape' in raw && 'data' in raw)) {
12
- return false;
13
- }
14
- var _a = raw, shape = _a.shape, data = _a.data;
15
- if (!(Array.isArray(shape) && shape.every(function (e) { return typeof e === 'number'; })) ||
16
- !(Array.isArray(data) && data.every(function (e) { return typeof e === 'number'; }))) {
17
- return false;
18
- }
19
- // eslint-disable-next-line
20
- var _ = { shape: shape, data: data };
21
- return true;
22
- }
23
- function isEncoded(raw) {
24
- return Array.isArray(raw) && raw.every(function (e) { return typeof e === 'number'; });
25
- }
26
- exports.isEncoded = isEncoded;
27
- function encode(weights) {
28
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
29
- var serialized;
30
- var _this = this;
31
- return (0, tslib_1.__generator)(this, function (_a) {
32
- switch (_a.label) {
33
- case 0: return [4 /*yield*/, Promise.all(weights.weights.map(function (t) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
34
- var _a;
35
- var _b;
36
- return (0, tslib_1.__generator)(this, function (_c) {
37
- switch (_c.label) {
38
- case 0:
39
- _b = {
40
- shape: t.shape
41
- };
42
- _a = [[]];
43
- return [4 /*yield*/, t.data()];
44
- case 1: return [2 /*return*/, (_b.data = tslib_1.__spreadArray.apply(void 0, _a.concat([tslib_1.__read.apply(void 0, [_c.sent()]), false])),
45
- _b)];
46
- }
47
- });
48
- }); }))];
49
- case 1:
50
- serialized = _a.sent();
51
- return [2 /*return*/, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(msgpack.encode(serialized).values()), false)];
52
- }
53
- });
54
- });
55
- }
56
- exports.encode = encode;
57
- function decode(encoded) {
58
- var raw = msgpack.decode(encoded);
59
- if (!(Array.isArray(raw) && raw.every(isSerialized))) {
60
- throw new Error('expected to decode an array of serialized weights');
61
- }
62
- return new __1.WeightsContainer(raw.map(function (w) { return __1.tf.tensor(w.data, w.shape); }));
63
- }
64
- exports.decode = decode;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDataExample = void 0;
4
- var immutable_1 = require("immutable");
5
- function isDataExample(raw) {
6
- if (typeof raw !== 'object') {
7
- return false;
8
- }
9
- if (raw === null) {
10
- return false;
11
- }
12
- if (!(0, immutable_1.Set)(Object.keys(raw)).equals(immutable_1.Set.of('columnName', 'columnData'))) {
13
- return false;
14
- }
15
- var _a = raw, columnName = _a.columnName, columnData = _a.columnData;
16
- if (typeof columnName !== 'string' ||
17
- (typeof columnData !== 'string' && typeof columnData !== 'number')) {
18
- return false;
19
- }
20
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
21
- var _ = { columnName: columnName, columnData: columnData };
22
- return true;
23
- }
24
- exports.isDataExample = isDataExample;
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDisplayInformation = void 0;
4
- var summary_1 = require("./summary");
5
- var data_example_1 = require("./data_example");
6
- function isDisplayInformation(raw) {
7
- if (typeof raw !== 'object') {
8
- return false;
9
- }
10
- if (raw === null) {
11
- return false;
12
- }
13
- var _a = raw, dataExample = _a.dataExample, dataExampleImage = _a.dataExampleImage, dataExampleText = _a.dataExampleText, dataFormatInformation = _a.dataFormatInformation, headers = _a.headers, limitations = _a.limitations, model = _a.model, summary = _a.summary, taskTitle = _a.taskTitle, tradeoffs = _a.tradeoffs;
14
- if (typeof taskTitle !== 'string' ||
15
- (dataExampleText !== undefined && typeof dataExampleText !== 'string') ||
16
- (dataFormatInformation !== undefined && typeof dataFormatInformation !== 'string') ||
17
- (tradeoffs !== undefined && typeof tradeoffs !== 'string') ||
18
- (model !== undefined && typeof model !== 'string') ||
19
- (dataExampleImage !== undefined && typeof dataExampleImage !== 'string') ||
20
- (limitations !== undefined && typeof limitations !== 'string')) {
21
- return false;
22
- }
23
- if (summary !== undefined && !(0, summary_1.isSummary)(summary)) {
24
- return false;
25
- }
26
- if (dataExample !== undefined && !(Array.isArray(dataExample) &&
27
- dataExample.every(data_example_1.isDataExample))) {
28
- return false;
29
- }
30
- if (headers !== undefined && !(Array.isArray(headers) &&
31
- headers.every(function (e) { return typeof e === 'string'; }))) {
32
- return false;
33
- }
34
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
35
- var _ = {
36
- taskTitle: taskTitle,
37
- summary: summary,
38
- tradeoffs: tradeoffs,
39
- dataFormatInformation: dataFormatInformation,
40
- dataExampleText: dataExampleText,
41
- model: model,
42
- dataExample: dataExample,
43
- headers: headers,
44
- dataExampleImage: dataExampleImage,
45
- limitations: limitations
46
- };
47
- return true;
48
- }
49
- exports.isDisplayInformation = isDisplayInformation;
@@ -1,3 +0,0 @@
1
- export { isTask, Task, isTaskID, TaskID } from './task';
2
- export { isDisplayInformation, DisplayInformation } from './display_information';
3
- export { TrainingInformation } from './training_information';
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDisplayInformation = exports.isTaskID = exports.isTask = void 0;
4
- var task_1 = require("./task");
5
- Object.defineProperty(exports, "isTask", { enumerable: true, get: function () { return task_1.isTask; } });
6
- Object.defineProperty(exports, "isTaskID", { enumerable: true, get: function () { return task_1.isTaskID; } });
7
- var display_information_1 = require("./display_information");
8
- Object.defineProperty(exports, "isDisplayInformation", { enumerable: true, get: function () { return display_information_1.isDisplayInformation; } });
@@ -1,6 +0,0 @@
1
- export declare function isModelCompileData(raw: unknown): raw is ModelCompileData;
2
- export interface ModelCompileData {
3
- optimizer: string;
4
- loss: string;
5
- metrics: string[];
6
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isModelCompileData = void 0;
4
- function isModelCompileData(raw) {
5
- if (typeof raw !== 'object') {
6
- return false;
7
- }
8
- if (raw === null) {
9
- return false;
10
- }
11
- var _a = raw, optimizer = _a.optimizer, loss = _a.loss, metrics = _a.metrics;
12
- if (typeof optimizer !== 'string' ||
13
- typeof loss !== 'string') {
14
- return false;
15
- }
16
- if (!(Array.isArray(metrics) &&
17
- metrics.every(function (e) { return typeof e === 'string'; }))) {
18
- return false;
19
- }
20
- return true;
21
- }
22
- exports.isModelCompileData = isModelCompileData;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSummary = void 0;
4
- function isSummary(raw) {
5
- if (typeof raw !== 'object') {
6
- return false;
7
- }
8
- if (raw === null) {
9
- return false;
10
- }
11
- var _a = raw, preview = _a.preview, overview = _a.overview;
12
- if (!(typeof preview === 'string' && typeof overview === 'string')) {
13
- return false;
14
- }
15
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
16
- var _ = { preview: preview, overview: overview };
17
- return true;
18
- }
19
- exports.isSummary = isSummary;
@@ -1,10 +0,0 @@
1
- import { DisplayInformation } from './display_information';
2
- import { TrainingInformation } from './training_information';
3
- export declare type TaskID = string;
4
- export declare function isTaskID(obj: unknown): obj is TaskID;
5
- export declare function isTask(raw: unknown): raw is Task;
6
- export interface Task {
7
- taskID: TaskID;
8
- displayInformation: DisplayInformation;
9
- trainingInformation: TrainingInformation;
10
- }
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTask = exports.isTaskID = void 0;
4
- var display_information_1 = require("./display_information");
5
- var training_information_1 = require("./training_information");
6
- function isTaskID(obj) {
7
- return typeof obj === 'string';
8
- }
9
- exports.isTaskID = isTaskID;
10
- function isTask(raw) {
11
- if (typeof raw !== 'object') {
12
- return false;
13
- }
14
- if (raw === null) {
15
- return false;
16
- }
17
- var _a = raw, taskID = _a.taskID, displayInformation = _a.displayInformation, trainingInformation = _a.trainingInformation;
18
- if (typeof taskID !== 'string') {
19
- return false;
20
- }
21
- if (!(0, display_information_1.isDisplayInformation)(displayInformation)) {
22
- return false;
23
- }
24
- if (!(0, training_information_1.isTrainingInformation)(trainingInformation)) {
25
- return false;
26
- }
27
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
- var _ = { taskID: taskID, displayInformation: displayInformation, trainingInformation: trainingInformation };
29
- return true;
30
- }
31
- exports.isTask = isTask;
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTrainingInformation = void 0;
4
- var model_compile_data_1 = require("./model_compile_data");
5
- function isTrainingInformation(raw) {
6
- if (typeof raw !== 'object') {
7
- return false;
8
- }
9
- if (raw === null) {
10
- return false;
11
- }
12
- var _a = raw, dataType = _a.dataType, scheme = _a.scheme, epochs = _a.epochs,
13
- // roundDuration,
14
- validationSplit = _a.validationSplit, batchSize = _a.batchSize, modelCompileData = _a.modelCompileData, modelID = _a.modelID, preprocessingFunctions = _a.preprocessingFunctions, inputColumns = _a.inputColumns, outputColumns = _a.outputColumns, IMAGE_H = _a.IMAGE_H, IMAGE_W = _a.IMAGE_W, roundDuration = _a.roundDuration, modelURL = _a.modelURL, learningRate = _a.learningRate, decentralizedSecure = _a.decentralizedSecure, maxShareValue = _a.maxShareValue, minimumReadyPeers = _a.minimumReadyPeers, LABEL_LIST = _a.LABEL_LIST, noiseScale = _a.noiseScale, clippingRadius = _a.clippingRadius;
15
- if (typeof dataType !== 'string' ||
16
- typeof modelID !== 'string' ||
17
- typeof epochs !== 'number' ||
18
- typeof batchSize !== 'number' ||
19
- typeof roundDuration !== 'number' ||
20
- typeof validationSplit !== 'number' ||
21
- (modelURL !== undefined && typeof modelURL !== 'string') ||
22
- (noiseScale !== undefined && typeof noiseScale !== 'number') ||
23
- (clippingRadius !== undefined && typeof clippingRadius !== 'number') ||
24
- (learningRate !== undefined && typeof learningRate !== 'number') ||
25
- (decentralizedSecure !== undefined && typeof decentralizedSecure !== 'boolean') ||
26
- (maxShareValue !== undefined && typeof maxShareValue !== 'number') ||
27
- (minimumReadyPeers !== undefined && typeof minimumReadyPeers !== 'number')) {
28
- return false;
29
- }
30
- // interdepences on data type
31
- switch (dataType) {
32
- case 'image':
33
- if (typeof IMAGE_H !== 'number' || typeof IMAGE_W !== 'number') {
34
- return false;
35
- }
36
- break;
37
- case 'tabular':
38
- if (!(Array.isArray(inputColumns) && inputColumns.every(function (e) { return typeof e === 'string'; }))) {
39
- return false;
40
- }
41
- if (!(Array.isArray(outputColumns) && outputColumns.every(function (e) { return typeof e === 'string'; }))) {
42
- return false;
43
- }
44
- break;
45
- }
46
- // interdepences on scheme
47
- switch (scheme) {
48
- case 'decentralized':
49
- break;
50
- case 'federated':
51
- break;
52
- case 'local':
53
- break;
54
- }
55
- if (!(0, model_compile_data_1.isModelCompileData)(modelCompileData)) {
56
- return false;
57
- }
58
- if (LABEL_LIST !== undefined && !(Array.isArray(LABEL_LIST) && LABEL_LIST.every(function (e) { return typeof e === 'string'; }))) {
59
- return false;
60
- }
61
- if (preprocessingFunctions !== undefined && !(Array.isArray(preprocessingFunctions) && preprocessingFunctions.every(function (e) { return typeof e === 'string'; }))) {
62
- return false;
63
- }
64
- return true;
65
- }
66
- exports.isTrainingInformation = isTrainingInformation;
@@ -1,3 +0,0 @@
1
- import { tf, Task } from '..';
2
- export declare const task: Task;
3
- export declare function model(): Promise<tf.LayersModel>;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.model = exports.task = void 0;
4
- var tslib_1 = require("tslib");
5
- var __1 = require("..");
6
- exports.task = {
7
- taskID: 'cifar10',
8
- displayInformation: {
9
- taskTitle: 'CIFAR10',
10
- summary: {
11
- preview: 'In this challenge, we ask you to classify images into categories based on the objects shown on the image.',
12
- overview: 'The CIFAR-10 dataset is a collection of images that are commonly used to train machine learning and computer vision algorithms. It is one of the most widely used datasets for machine learning research.'
13
- },
14
- limitations: 'The training data is limited to small images of size 32x32.',
15
- tradeoffs: 'Training success strongly depends on label distribution',
16
- dataFormatInformation: 'Images should be of .png format and of size 32x32. <br> The label file should be .csv, where each row contains a file_name, class. <br> <br> e.g. if you have images: 0.png (of a frog) and 1.png (of a car) <br> labels.csv contains: (Note that no header is needed)<br> 0.png, frog <br> 1.png, car',
17
- dataExampleText: 'Below you can find 10 random examples from each of the 10 classes in the dataset.',
18
- dataExampleImage: 'https://storage.googleapis.com/deai-313515.appspot.com/example_training_data/cifar10-example.png'
19
- },
20
- trainingInformation: {
21
- modelID: 'cifar10-model',
22
- epochs: 10,
23
- roundDuration: 10,
24
- validationSplit: 0.2,
25
- batchSize: 10,
26
- modelCompileData: {
27
- optimizer: 'sgd',
28
- loss: 'categoricalCrossentropy',
29
- metrics: ['accuracy']
30
- },
31
- dataType: 'image',
32
- IMAGE_H: 32,
33
- IMAGE_W: 32,
34
- preprocessingFunctions: [],
35
- LABEL_LIST: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
36
- scheme: 'Decentralized',
37
- noiseScale: undefined,
38
- clippingRadius: 20,
39
- decentralizedSecure: true,
40
- minimumReadyPeers: 3,
41
- maxShareValue: 100
42
- }
43
- };
44
- function model() {
45
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
46
- var mobilenet, x, predictions;
47
- return (0, tslib_1.__generator)(this, function (_a) {
48
- switch (_a.label) {
49
- case 0: return [4 /*yield*/, __1.tf.loadLayersModel('https://storage.googleapis.com/tfjs-models/tfjs/mobilenet_v1_0.25_224/model.json')];
50
- case 1:
51
- mobilenet = _a.sent();
52
- x = mobilenet.getLayer('global_average_pooling2d_1');
53
- predictions = __1.tf.layers
54
- .dense({ units: 10, activation: 'softmax', name: 'denseModified' })
55
- .apply(x.output);
56
- return [2 /*return*/, __1.tf.model({
57
- inputs: mobilenet.input,
58
- outputs: predictions,
59
- name: 'modelModified'
60
- })];
61
- }
62
- });
63
- });
64
- }
65
- exports.model = model;
@@ -1,3 +0,0 @@
1
- import { tf, Task } from '..';
2
- export declare const task: Task;
3
- export declare function model(_?: string): Promise<tf.LayersModel>;
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.model = exports.task = void 0;
4
- var tslib_1 = require("tslib");
5
- var __1 = require("..");
6
- var immutable_1 = require("immutable");
7
- exports.task = {
8
- taskID: 'geotags',
9
- displayInformation: {
10
- taskTitle: 'GeoTags',
11
- summary: {
12
- preview: 'In this challenge, we predict the geo-location of a photo given its pixels in terms of a cell number of a grid built on top of Switzerland',
13
- overview: 'The geotags dataset is a collection of images with geo-location information used to train a machine learning algorithm to predict the location of a photo given its pixels.'
14
- },
15
- limitations: 'The training data is limited to images of size 224x224.',
16
- tradeoffs: 'Training success strongly depends on label distribution',
17
- dataFormatInformation: 'Images should be of .png format and of size 224x224. <br> The label file should be .csv, where each row contains a file_name, class. The class is the cell number of a the given grid of Switzerland. '
18
- },
19
- trainingInformation: {
20
- modelID: 'geotags-model',
21
- epochs: 10,
22
- roundDuration: 10,
23
- validationSplit: 0.2,
24
- batchSize: 10,
25
- modelCompileData: {
26
- optimizer: 'adam',
27
- loss: 'categoricalCrossentropy',
28
- metrics: ['accuracy']
29
- },
30
- dataType: 'image',
31
- IMAGE_H: 224,
32
- IMAGE_W: 224,
33
- preprocessingFunctions: [__1.data.ImagePreprocessing.Resize],
34
- LABEL_LIST: (0, immutable_1.Range)(0, 140).map(String).toArray(),
35
- scheme: 'Federated',
36
- noiseScale: undefined,
37
- clippingRadius: 20,
38
- decentralizedSecure: true,
39
- minimumReadyPeers: 3,
40
- maxShareValue: 100
41
- }
42
- };
43
- function model(_) {
44
- if (_ === void 0) { _ = ''; }
45
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
46
- var pretrainedModel, numLayers, model;
47
- return (0, tslib_1.__generator)(this, function (_a) {
48
- switch (_a.label) {
49
- case 0: return [4 /*yield*/, __1.tf.loadLayersModel('https://storage.googleapis.com/epfl-disco-models/geotags/v2/model.json')];
50
- case 1:
51
- pretrainedModel = _a.sent();
52
- numLayers = pretrainedModel.layers.length;
53
- pretrainedModel.layers.forEach(function (layer) { layer.trainable = false; });
54
- pretrainedModel.layers[numLayers - 1].trainable = true;
55
- model = __1.tf.sequential({
56
- layers: [
57
- __1.tf.layers.inputLayer({ inputShape: [224, 224, 3] }),
58
- __1.tf.layers.rescaling({ scale: 1 / 127.5, offset: -1 }),
59
- pretrainedModel
60
- ]
61
- });
62
- return [2 /*return*/, model];
63
- }
64
- });
65
- });
66
- }
67
- exports.model = model;
@@ -1,6 +0,0 @@
1
- export * as cifar10 from './cifar10';
2
- export * as lus_covid from './lus_covid';
3
- export * as mnist from './mnist';
4
- export * as titanic from './titanic';
5
- export * as simple_face from './simple_face';
6
- export * as geotags from './geotags';
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.geotags = exports.simple_face = exports.titanic = exports.mnist = exports.lus_covid = exports.cifar10 = void 0;
4
- var tslib_1 = require("tslib");
5
- exports.cifar10 = (0, tslib_1.__importStar)(require("./cifar10"));
6
- exports.lus_covid = (0, tslib_1.__importStar)(require("./lus_covid"));
7
- exports.mnist = (0, tslib_1.__importStar)(require("./mnist"));
8
- exports.titanic = (0, tslib_1.__importStar)(require("./titanic"));
9
- exports.simple_face = (0, tslib_1.__importStar)(require("./simple_face"));
10
- exports.geotags = (0, tslib_1.__importStar)(require("./geotags"));
@@ -1,3 +0,0 @@
1
- import { tf, Task } from '..';
2
- export declare const task: Task;
3
- export declare function model(): tf.LayersModel;
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.model = exports.task = void 0;
4
- var __1 = require("..");
5
- exports.task = {
6
- taskID: 'lus_covid',
7
- displayInformation: {
8
- taskTitle: 'COVID Lung Ultrasound',
9
- summary: {
10
- preview: 'Do you have a dataset of lung ultrasound images on patients <b>suspected of Lower Respiratory Tract infection (LRTI) during the COVID pandemic</b>? <br> Learn how to discriminate between COVID positive and negative patients by joining this task.',
11
- overview: "Don’t have a dataset of your own? Download a sample of a few cases <a class='underline' href='https://drive.switch.ch/index.php/s/zM5ZrUWK3taaIly' target='_blank'>here</a>."
12
- },
13
- model: "We use a simplified* version of the <b>DeepChest model</b>: A deep learning model developed in our lab (<a class='underline' href='https://www.epfl.ch/labs/mlo/igh-intelligent-global-health/'>intelligent Global Health</a>.). On a cohort of 400 Swiss patients suspected of LRTI, the model obtained over 90% area under the ROC curve for this task. <br><br>*Simplified to ensure smooth running on your browser, the performance is minimally affected. Details of the adaptations are below <br>- <b>Removed</b>: positional embedding (i.e. we don’t take the anatomic position into consideration). Rather, the model now does mean pooling over the feature vector of the images for each patient <br>- <b>Replaced</b>: ResNet18 by Mobilenet",
14
- tradeoffs: 'We are using a simpler version of DeepChest in order to be able to run it on the browser.',
15
- dataFormatInformation: 'This model takes as input an image dataset. It consists on a set of lung ultrasound images per patient with its corresponding label of covid positive or negative. Moreover, to identify the images per patient you have to follow the follwing naming pattern: "patientId_*.png"',
16
- dataExampleText: 'Below you can find an example of an expected lung image for patient 2 named: 2_QAID_1.masked.reshaped.squared.224.png',
17
- dataExampleImage: 'https://storage.googleapis.com/deai-313515.appspot.com/example_training_data/2_QAID_1.masked.reshaped.squared.224.png'
18
- },
19
- trainingInformation: {
20
- modelID: 'lus-covid-model',
21
- epochs: 15,
22
- roundDuration: 10,
23
- validationSplit: 0.2,
24
- batchSize: 2,
25
- modelCompileData: {
26
- optimizer: 'sgd',
27
- loss: 'binaryCrossentropy',
28
- metrics: ['accuracy']
29
- },
30
- learningRate: 0.001,
31
- IMAGE_H: 100,
32
- IMAGE_W: 100,
33
- preprocessingFunctions: [__1.data.ImagePreprocessing.Resize],
34
- LABEL_LIST: ['COVID-Positive', 'COVID-Negative'],
35
- dataType: 'image',
36
- scheme: 'Decentralized',
37
- noiseScale: undefined,
38
- clippingRadius: 20,
39
- decentralizedSecure: true,
40
- minimumReadyPeers: 3,
41
- maxShareValue: 100
42
- }
43
- };
44
- function model() {
45
- var imageHeight = 100;
46
- var imageWidth = 100;
47
- var imageChannels = 3;
48
- var numOutputClasses = 2;
49
- var model = __1.tf.sequential();
50
- // In the first layer of our convolutional neural network we have
51
- // to specify the input shape. Then we specify some parameters for
52
- // the convolution operation that takes place in this layer.
53
- model.add(__1.tf.layers.conv2d({
54
- inputShape: [imageHeight, imageWidth, imageChannels],
55
- kernelSize: 5,
56
- filters: 8,
57
- strides: 1,
58
- activation: 'relu',
59
- kernelInitializer: 'varianceScaling'
60
- }));
61
- // The MaxPooling layer acts as a sort of downsampling using max values
62
- // in a region instead of averaging.
63
- model.add(__1.tf.layers.maxPooling2d({ poolSize: [2, 2], strides: [2, 2] }));
64
- // Repeat another conv2d + maxPooling stack.
65
- // Note that we have more filters in the convolution.
66
- model.add(__1.tf.layers.conv2d({
67
- kernelSize: 5,
68
- filters: 16,
69
- strides: 1,
70
- activation: 'relu',
71
- kernelInitializer: 'varianceScaling'
72
- }));
73
- model.add(__1.tf.layers.maxPooling2d({ poolSize: [2, 2], strides: [2, 2] }));
74
- // Now we flatten the output from the 2D filters into a 1D vector to prepare
75
- // it for input into our last layer. This is common practice when feeding
76
- // higher dimensional data to a final classification output layer.
77
- model.add(__1.tf.layers.flatten());
78
- // Our last layer is a dense layer which has 2 output units, one for each
79
- // output class.
80
- model.add(__1.tf.layers.dense({
81
- units: numOutputClasses,
82
- kernelInitializer: 'varianceScaling',
83
- activation: 'softmax'
84
- }));
85
- return model;
86
- }
87
- exports.model = model;
@@ -1,3 +0,0 @@
1
- import { tf, Task } from '..';
2
- export declare const task: Task;
3
- export declare function model(): tf.LayersModel;
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.model = exports.task = void 0;
4
- var __1 = require("..");
5
- exports.task = {
6
- taskID: 'mnist',
7
- displayInformation: {
8
- taskTitle: 'MNIST',
9
- summary: {
10
- preview: "Test our platform by using a publicly available <b>image</b> dataset. <br><br> Download the classic MNIST imagebank of hand-written numbers <a class='underline text-primary-dark dark:text-primary-light' href='https://www.kaggle.com/scolianni/mnistasjpg'>here</a>. <br> This model learns to identify hand written numbers.",
11
- overview: 'The MNIST handwritten digit classification problem is a standard dataset used in computer vision and deep learning. Although the dataset is effectively solved, we use it to test our Decentralised Learning algorithms and platform.'
12
- },
13
- model: 'The current model is a very simple CNN and its main goal is to test the app and the Decentralizsed Learning functionality.',
14
- tradeoffs: 'We are using a simple model, first a 2d convolutional layer > max pooling > 2d convolutional layer > max pooling > convolutional layer > 2 dense layers.',
15
- dataFormatInformation: 'This model is trained on images corresponding to digits 0 to 9. You can upload each digit image of your dataset in the box corresponding to its label. The model taskes images of size 28x28 as input.',
16
- dataExampleText: 'Below you can find an example of an expected image representing the digit 9.',
17
- dataExampleImage: 'http://storage.googleapis.com/deai-313515.appspot.com/example_training_data/9-mnist-example.png'
18
- },
19
- trainingInformation: {
20
- modelID: 'mnist-model',
21
- epochs: 10,
22
- roundDuration: 10,
23
- validationSplit: 0.2,
24
- batchSize: 30,
25
- modelCompileData: {
26
- optimizer: 'rmsprop',
27
- loss: 'categoricalCrossentropy',
28
- metrics: ['accuracy']
29
- },
30
- dataType: 'image',
31
- IMAGE_H: 28,
32
- IMAGE_W: 28,
33
- preprocessingFunctions: [],
34
- LABEL_LIST: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
35
- scheme: 'Decentralized',
36
- noiseScale: undefined,
37
- clippingRadius: 20,
38
- decentralizedSecure: true,
39
- minimumReadyPeers: 3,
40
- maxShareValue: 100
41
- }
42
- };
43
- function model() {
44
- var model = __1.tf.sequential();
45
- model.add(__1.tf.layers.conv2d({
46
- inputShape: [28, 28, 3],
47
- kernelSize: 3,
48
- filters: 16,
49
- activation: 'relu'
50
- }));
51
- model.add(__1.tf.layers.maxPooling2d({ poolSize: 2, strides: 2 }));
52
- model.add(__1.tf.layers.conv2d({ kernelSize: 3, filters: 32, activation: 'relu' }));
53
- model.add(__1.tf.layers.maxPooling2d({ poolSize: 2, strides: 2 }));
54
- model.add(__1.tf.layers.conv2d({ kernelSize: 3, filters: 32, activation: 'relu' }));
55
- model.add(__1.tf.layers.flatten({}));
56
- model.add(__1.tf.layers.dense({ units: 64, activation: 'relu' }));
57
- model.add(__1.tf.layers.dense({ units: 10, activation: 'softmax' }));
58
- return model;
59
- }
60
- exports.model = model;
@@ -1,2 +0,0 @@
1
- import { Task } from '..';
2
- export declare const task: Task;