@epfml/discojs 3.0.1-p20250814105822.0 → 3.0.1-p20250924150135.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 (65) hide show
  1. package/dist/aggregator/get.d.ts +3 -3
  2. package/dist/aggregator/get.js +1 -2
  3. package/dist/client/client.d.ts +6 -6
  4. package/dist/client/decentralized/decentralized_client.d.ts +1 -1
  5. package/dist/client/decentralized/peer_pool.d.ts +1 -1
  6. package/dist/client/federated/federated_client.d.ts +1 -1
  7. package/dist/client/local_client.d.ts +1 -1
  8. package/dist/client/utils.d.ts +2 -2
  9. package/dist/client/utils.js +19 -10
  10. package/dist/default_tasks/cifar10.d.ts +2 -2
  11. package/dist/default_tasks/cifar10.js +9 -8
  12. package/dist/default_tasks/lus_covid.d.ts +2 -2
  13. package/dist/default_tasks/lus_covid.js +9 -8
  14. package/dist/default_tasks/mnist.d.ts +2 -2
  15. package/dist/default_tasks/mnist.js +9 -8
  16. package/dist/default_tasks/simple_face.d.ts +2 -2
  17. package/dist/default_tasks/simple_face.js +9 -8
  18. package/dist/default_tasks/tinder_dog.d.ts +1 -1
  19. package/dist/default_tasks/tinder_dog.js +12 -10
  20. package/dist/default_tasks/titanic.d.ts +2 -2
  21. package/dist/default_tasks/titanic.js +20 -33
  22. package/dist/default_tasks/wikitext.d.ts +2 -2
  23. package/dist/default_tasks/wikitext.js +16 -13
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/models/gpt/config.d.ts +2 -2
  27. package/dist/models/hellaswag.d.ts +2 -3
  28. package/dist/models/hellaswag.js +3 -4
  29. package/dist/models/index.d.ts +2 -3
  30. package/dist/models/index.js +2 -3
  31. package/dist/models/tokenizer.d.ts +24 -14
  32. package/dist/models/tokenizer.js +42 -21
  33. package/dist/processing/index.d.ts +4 -5
  34. package/dist/processing/index.js +16 -21
  35. package/dist/serialization/coder.d.ts +5 -1
  36. package/dist/serialization/coder.js +4 -1
  37. package/dist/serialization/index.d.ts +4 -0
  38. package/dist/serialization/index.js +1 -0
  39. package/dist/serialization/task.d.ts +5 -0
  40. package/dist/serialization/task.js +34 -0
  41. package/dist/task/display_information.d.ts +91 -14
  42. package/dist/task/display_information.js +34 -58
  43. package/dist/task/index.d.ts +5 -5
  44. package/dist/task/index.js +4 -3
  45. package/dist/task/task.d.ts +837 -10
  46. package/dist/task/task.js +49 -21
  47. package/dist/task/task_handler.d.ts +4 -4
  48. package/dist/task/task_handler.js +14 -18
  49. package/dist/task/task_provider.d.ts +3 -3
  50. package/dist/task/training_information.d.ts +157 -35
  51. package/dist/task/training_information.js +85 -110
  52. package/dist/training/disco.d.ts +8 -8
  53. package/dist/training/disco.js +2 -1
  54. package/dist/training/trainer.d.ts +3 -3
  55. package/dist/training/trainer.js +2 -1
  56. package/dist/types/index.d.ts +1 -0
  57. package/dist/validator.d.ts +4 -4
  58. package/dist/validator.js +7 -6
  59. package/package.json +4 -7
  60. package/dist/processing/text.d.ts +0 -21
  61. package/dist/processing/text.js +0 -36
  62. package/dist/task/data_example.d.ts +0 -5
  63. package/dist/task/data_example.js +0 -14
  64. package/dist/task/summary.d.ts +0 -5
  65. package/dist/task/summary.js +0 -13
@@ -1,11 +1,838 @@
1
- import { DataType } from "../index.js";
2
- import { type DisplayInformation } from './display_information.js';
3
- import { type TrainingInformation } from './training_information.js';
4
- export type TaskID = string;
5
- export interface Task<D extends DataType> {
6
- id: TaskID;
7
- displayInformation: DisplayInformation;
8
- trainingInformation: TrainingInformation<D>;
1
+ import { z } from "zod";
2
+ import type { DataType, Network } from "../index.js";
3
+ export declare namespace Task {
4
+ type ID = string;
5
+ const baseSchema: z.ZodObject<{
6
+ id: z.ZodString;
7
+ displayInformation: z.ZodObject<{
8
+ title: z.ZodString;
9
+ summary: z.ZodObject<{
10
+ preview: z.ZodString;
11
+ overview: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ preview: string;
14
+ overview: string;
15
+ }, {
16
+ preview: string;
17
+ overview: string;
18
+ }>;
19
+ dataFormatInformation: z.ZodOptional<z.ZodString>;
20
+ model: z.ZodOptional<z.ZodString>;
21
+ sampleDataset: z.ZodOptional<z.ZodObject<{
22
+ link: z.ZodString;
23
+ instructions: z.ZodString;
24
+ }, "strip", z.ZodTypeAny, {
25
+ link: string;
26
+ instructions: string;
27
+ }, {
28
+ link: string;
29
+ instructions: string;
30
+ }>>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ title: string;
33
+ summary: {
34
+ preview: string;
35
+ overview: string;
36
+ };
37
+ dataFormatInformation?: string | undefined;
38
+ model?: string | undefined;
39
+ sampleDataset?: {
40
+ link: string;
41
+ instructions: string;
42
+ } | undefined;
43
+ }, {
44
+ title: string;
45
+ summary: {
46
+ preview: string;
47
+ overview: string;
48
+ };
49
+ dataFormatInformation?: string | undefined;
50
+ model?: string | undefined;
51
+ sampleDataset?: {
52
+ link: string;
53
+ instructions: string;
54
+ } | undefined;
55
+ }>;
56
+ trainingInformation: z.ZodObject<{
57
+ epochs: z.ZodNumber;
58
+ roundDuration: z.ZodNumber;
59
+ validationSplit: z.ZodNumber;
60
+ batchSize: z.ZodNumber;
61
+ tensorBackend: z.ZodEnum<["gpt", "tfjs"]>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ epochs: number;
64
+ roundDuration: number;
65
+ validationSplit: number;
66
+ batchSize: number;
67
+ tensorBackend: "gpt" | "tfjs";
68
+ }, {
69
+ epochs: number;
70
+ roundDuration: number;
71
+ validationSplit: number;
72
+ batchSize: number;
73
+ tensorBackend: "gpt" | "tfjs";
74
+ }>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ id: string;
77
+ displayInformation: {
78
+ title: string;
79
+ summary: {
80
+ preview: string;
81
+ overview: string;
82
+ };
83
+ dataFormatInformation?: string | undefined;
84
+ model?: string | undefined;
85
+ sampleDataset?: {
86
+ link: string;
87
+ instructions: string;
88
+ } | undefined;
89
+ };
90
+ trainingInformation: {
91
+ epochs: number;
92
+ roundDuration: number;
93
+ validationSplit: number;
94
+ batchSize: number;
95
+ tensorBackend: "gpt" | "tfjs";
96
+ };
97
+ }, {
98
+ id: string;
99
+ displayInformation: {
100
+ title: string;
101
+ summary: {
102
+ preview: string;
103
+ overview: string;
104
+ };
105
+ dataFormatInformation?: string | undefined;
106
+ model?: string | undefined;
107
+ sampleDataset?: {
108
+ link: string;
109
+ instructions: string;
110
+ } | undefined;
111
+ };
112
+ trainingInformation: {
113
+ epochs: number;
114
+ roundDuration: number;
115
+ validationSplit: number;
116
+ batchSize: number;
117
+ tensorBackend: "gpt" | "tfjs";
118
+ };
119
+ }>;
120
+ const dataTypeToSchema: {
121
+ image: z.ZodObject<{
122
+ dataType: z.ZodLiteral<"image">;
123
+ displayInformation: z.ZodObject<{
124
+ dataExample: z.ZodOptional<z.ZodString>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ dataExample?: string | undefined;
127
+ }, {
128
+ dataExample?: string | undefined;
129
+ }>;
130
+ trainingInformation: z.ZodObject<{
131
+ LABEL_LIST: z.ZodArray<z.ZodString, "many">;
132
+ IMAGE_W: z.ZodNumber;
133
+ IMAGE_H: z.ZodNumber;
134
+ }, "strip", z.ZodTypeAny, {
135
+ LABEL_LIST: string[];
136
+ IMAGE_W: number;
137
+ IMAGE_H: number;
138
+ }, {
139
+ LABEL_LIST: string[];
140
+ IMAGE_W: number;
141
+ IMAGE_H: number;
142
+ }>;
143
+ }, "strip", z.ZodTypeAny, {
144
+ displayInformation: {
145
+ dataExample?: string | undefined;
146
+ };
147
+ trainingInformation: {
148
+ LABEL_LIST: string[];
149
+ IMAGE_W: number;
150
+ IMAGE_H: number;
151
+ };
152
+ dataType: "image";
153
+ }, {
154
+ displayInformation: {
155
+ dataExample?: string | undefined;
156
+ };
157
+ trainingInformation: {
158
+ LABEL_LIST: string[];
159
+ IMAGE_W: number;
160
+ IMAGE_H: number;
161
+ };
162
+ dataType: "image";
163
+ }>;
164
+ tabular: z.ZodObject<{
165
+ dataType: z.ZodLiteral<"tabular">;
166
+ displayInformation: z.ZodObject<{
167
+ dataExample: z.ZodOptional<z.ZodArray<z.ZodObject<{
168
+ name: z.ZodString;
169
+ data: z.ZodString;
170
+ }, "strip", z.ZodTypeAny, {
171
+ name: string;
172
+ data: string;
173
+ }, {
174
+ name: string;
175
+ data: string;
176
+ }>, "many">>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ dataExample?: {
179
+ name: string;
180
+ data: string;
181
+ }[] | undefined;
182
+ }, {
183
+ dataExample?: {
184
+ name: string;
185
+ data: string;
186
+ }[] | undefined;
187
+ }>;
188
+ trainingInformation: z.ZodObject<{
189
+ inputColumns: z.ZodArray<z.ZodString, "many">;
190
+ outputColumn: z.ZodString;
191
+ }, "strip", z.ZodTypeAny, {
192
+ inputColumns: string[];
193
+ outputColumn: string;
194
+ }, {
195
+ inputColumns: string[];
196
+ outputColumn: string;
197
+ }>;
198
+ }, "strip", z.ZodTypeAny, {
199
+ displayInformation: {
200
+ dataExample?: {
201
+ name: string;
202
+ data: string;
203
+ }[] | undefined;
204
+ };
205
+ trainingInformation: {
206
+ inputColumns: string[];
207
+ outputColumn: string;
208
+ };
209
+ dataType: "tabular";
210
+ }, {
211
+ displayInformation: {
212
+ dataExample?: {
213
+ name: string;
214
+ data: string;
215
+ }[] | undefined;
216
+ };
217
+ trainingInformation: {
218
+ inputColumns: string[];
219
+ outputColumn: string;
220
+ };
221
+ dataType: "tabular";
222
+ }>;
223
+ text: z.ZodObject<{
224
+ dataType: z.ZodLiteral<"text">;
225
+ displayInformation: z.ZodObject<{
226
+ dataExample: z.ZodOptional<z.ZodString>;
227
+ }, "strip", z.ZodTypeAny, {
228
+ dataExample?: string | undefined;
229
+ }, {
230
+ dataExample?: string | undefined;
231
+ }>;
232
+ trainingInformation: z.ZodObject<{
233
+ tokenizer: z.ZodType<import("../index.js").Tokenizer, z.ZodTypeDef, import("../index.js").Tokenizer>;
234
+ contextLength: z.ZodNumber;
235
+ }, "strip", z.ZodTypeAny, {
236
+ contextLength: number;
237
+ tokenizer: import("../index.js").Tokenizer;
238
+ }, {
239
+ contextLength: number;
240
+ tokenizer: import("../index.js").Tokenizer;
241
+ }>;
242
+ }, "strip", z.ZodTypeAny, {
243
+ displayInformation: {
244
+ dataExample?: string | undefined;
245
+ };
246
+ trainingInformation: {
247
+ contextLength: number;
248
+ tokenizer: import("../index.js").Tokenizer;
249
+ };
250
+ dataType: "text";
251
+ }, {
252
+ displayInformation: {
253
+ dataExample?: string | undefined;
254
+ };
255
+ trainingInformation: {
256
+ contextLength: number;
257
+ tokenizer: import("../index.js").Tokenizer;
258
+ };
259
+ dataType: "text";
260
+ }>;
261
+ };
262
+ const networkToSchema: {
263
+ decentralized: z.ZodObject<{
264
+ trainingInformation: z.ZodIntersection<z.ZodObject<{
265
+ scheme: z.ZodLiteral<"decentralized">;
266
+ } & {
267
+ privacy: z.ZodOptional<z.ZodEffects<z.ZodObject<{
268
+ clippingRadius: z.ZodOptional<z.ZodNumber>;
269
+ noiseScale: z.ZodOptional<z.ZodNumber>;
270
+ }, "strip", z.ZodTypeAny, {
271
+ clippingRadius?: number | undefined;
272
+ noiseScale?: number | undefined;
273
+ }, {
274
+ clippingRadius?: number | undefined;
275
+ noiseScale?: number | undefined;
276
+ }>, {
277
+ clippingRadius?: number | undefined;
278
+ noiseScale?: number | undefined;
279
+ } | undefined, {
280
+ clippingRadius?: number | undefined;
281
+ noiseScale?: number | undefined;
282
+ }>>;
283
+ minNbOfParticipants: z.ZodNumber;
284
+ }, "strip", z.ZodTypeAny, {
285
+ scheme: "decentralized";
286
+ minNbOfParticipants: number;
287
+ privacy?: {
288
+ clippingRadius?: number | undefined;
289
+ noiseScale?: number | undefined;
290
+ } | undefined;
291
+ }, {
292
+ scheme: "decentralized";
293
+ minNbOfParticipants: number;
294
+ privacy?: {
295
+ clippingRadius?: number | undefined;
296
+ noiseScale?: number | undefined;
297
+ } | undefined;
298
+ }>, z.ZodUnion<[z.ZodObject<{
299
+ aggregationStrategy: z.ZodLiteral<"mean">;
300
+ }, "strip", z.ZodTypeAny, {
301
+ aggregationStrategy: "mean";
302
+ }, {
303
+ aggregationStrategy: "mean";
304
+ }>, z.ZodObject<{
305
+ aggregationStrategy: z.ZodLiteral<"secure">;
306
+ maxShareValue: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
307
+ }, "strip", z.ZodTypeAny, {
308
+ aggregationStrategy: "secure";
309
+ maxShareValue: number;
310
+ }, {
311
+ aggregationStrategy: "secure";
312
+ maxShareValue?: number | undefined;
313
+ }>]>>;
314
+ }, "strip", z.ZodTypeAny, {
315
+ trainingInformation: {
316
+ scheme: "decentralized";
317
+ minNbOfParticipants: number;
318
+ privacy?: {
319
+ clippingRadius?: number | undefined;
320
+ noiseScale?: number | undefined;
321
+ } | undefined;
322
+ } & ({
323
+ aggregationStrategy: "mean";
324
+ } | {
325
+ aggregationStrategy: "secure";
326
+ maxShareValue: number;
327
+ });
328
+ }, {
329
+ trainingInformation: {
330
+ scheme: "decentralized";
331
+ minNbOfParticipants: number;
332
+ privacy?: {
333
+ clippingRadius?: number | undefined;
334
+ noiseScale?: number | undefined;
335
+ } | undefined;
336
+ } & ({
337
+ aggregationStrategy: "mean";
338
+ } | {
339
+ aggregationStrategy: "secure";
340
+ maxShareValue?: number | undefined;
341
+ });
342
+ }>;
343
+ federated: z.ZodObject<{
344
+ trainingInformation: z.ZodObject<{
345
+ scheme: z.ZodLiteral<"federated">;
346
+ aggregationStrategy: z.ZodLiteral<"mean">;
347
+ } & {
348
+ privacy: z.ZodOptional<z.ZodEffects<z.ZodObject<{
349
+ clippingRadius: z.ZodOptional<z.ZodNumber>;
350
+ noiseScale: z.ZodOptional<z.ZodNumber>;
351
+ }, "strip", z.ZodTypeAny, {
352
+ clippingRadius?: number | undefined;
353
+ noiseScale?: number | undefined;
354
+ }, {
355
+ clippingRadius?: number | undefined;
356
+ noiseScale?: number | undefined;
357
+ }>, {
358
+ clippingRadius?: number | undefined;
359
+ noiseScale?: number | undefined;
360
+ } | undefined, {
361
+ clippingRadius?: number | undefined;
362
+ noiseScale?: number | undefined;
363
+ }>>;
364
+ minNbOfParticipants: z.ZodNumber;
365
+ }, "strip", z.ZodTypeAny, {
366
+ scheme: "federated";
367
+ minNbOfParticipants: number;
368
+ aggregationStrategy: "mean";
369
+ privacy?: {
370
+ clippingRadius?: number | undefined;
371
+ noiseScale?: number | undefined;
372
+ } | undefined;
373
+ }, {
374
+ scheme: "federated";
375
+ minNbOfParticipants: number;
376
+ aggregationStrategy: "mean";
377
+ privacy?: {
378
+ clippingRadius?: number | undefined;
379
+ noiseScale?: number | undefined;
380
+ } | undefined;
381
+ }>;
382
+ }, "strip", z.ZodTypeAny, {
383
+ trainingInformation: {
384
+ scheme: "federated";
385
+ minNbOfParticipants: number;
386
+ aggregationStrategy: "mean";
387
+ privacy?: {
388
+ clippingRadius?: number | undefined;
389
+ noiseScale?: number | undefined;
390
+ } | undefined;
391
+ };
392
+ }, {
393
+ trainingInformation: {
394
+ scheme: "federated";
395
+ minNbOfParticipants: number;
396
+ aggregationStrategy: "mean";
397
+ privacy?: {
398
+ clippingRadius?: number | undefined;
399
+ noiseScale?: number | undefined;
400
+ } | undefined;
401
+ };
402
+ }>;
403
+ local: z.ZodObject<{
404
+ trainingInformation: z.ZodObject<{
405
+ scheme: z.ZodLiteral<"local">;
406
+ aggregationStrategy: z.ZodLiteral<"mean">;
407
+ }, "strip", z.ZodTypeAny, {
408
+ scheme: "local";
409
+ aggregationStrategy: "mean";
410
+ }, {
411
+ scheme: "local";
412
+ aggregationStrategy: "mean";
413
+ }>;
414
+ }, "strip", z.ZodTypeAny, {
415
+ trainingInformation: {
416
+ scheme: "local";
417
+ aggregationStrategy: "mean";
418
+ };
419
+ }, {
420
+ trainingInformation: {
421
+ scheme: "local";
422
+ aggregationStrategy: "mean";
423
+ };
424
+ }>;
425
+ };
426
+ const schema: z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
427
+ id: z.ZodString;
428
+ displayInformation: z.ZodObject<{
429
+ title: z.ZodString;
430
+ summary: z.ZodObject<{
431
+ preview: z.ZodString;
432
+ overview: z.ZodString;
433
+ }, "strip", z.ZodTypeAny, {
434
+ preview: string;
435
+ overview: string;
436
+ }, {
437
+ preview: string;
438
+ overview: string;
439
+ }>;
440
+ dataFormatInformation: z.ZodOptional<z.ZodString>;
441
+ model: z.ZodOptional<z.ZodString>;
442
+ sampleDataset: z.ZodOptional<z.ZodObject<{
443
+ link: z.ZodString;
444
+ instructions: z.ZodString;
445
+ }, "strip", z.ZodTypeAny, {
446
+ link: string;
447
+ instructions: string;
448
+ }, {
449
+ link: string;
450
+ instructions: string;
451
+ }>>;
452
+ }, "strip", z.ZodTypeAny, {
453
+ title: string;
454
+ summary: {
455
+ preview: string;
456
+ overview: string;
457
+ };
458
+ dataFormatInformation?: string | undefined;
459
+ model?: string | undefined;
460
+ sampleDataset?: {
461
+ link: string;
462
+ instructions: string;
463
+ } | undefined;
464
+ }, {
465
+ title: string;
466
+ summary: {
467
+ preview: string;
468
+ overview: string;
469
+ };
470
+ dataFormatInformation?: string | undefined;
471
+ model?: string | undefined;
472
+ sampleDataset?: {
473
+ link: string;
474
+ instructions: string;
475
+ } | undefined;
476
+ }>;
477
+ trainingInformation: z.ZodObject<{
478
+ epochs: z.ZodNumber;
479
+ roundDuration: z.ZodNumber;
480
+ validationSplit: z.ZodNumber;
481
+ batchSize: z.ZodNumber;
482
+ tensorBackend: z.ZodEnum<["gpt", "tfjs"]>;
483
+ }, "strip", z.ZodTypeAny, {
484
+ epochs: number;
485
+ roundDuration: number;
486
+ validationSplit: number;
487
+ batchSize: number;
488
+ tensorBackend: "gpt" | "tfjs";
489
+ }, {
490
+ epochs: number;
491
+ roundDuration: number;
492
+ validationSplit: number;
493
+ batchSize: number;
494
+ tensorBackend: "gpt" | "tfjs";
495
+ }>;
496
+ }, "strip", z.ZodTypeAny, {
497
+ id: string;
498
+ displayInformation: {
499
+ title: string;
500
+ summary: {
501
+ preview: string;
502
+ overview: string;
503
+ };
504
+ dataFormatInformation?: string | undefined;
505
+ model?: string | undefined;
506
+ sampleDataset?: {
507
+ link: string;
508
+ instructions: string;
509
+ } | undefined;
510
+ };
511
+ trainingInformation: {
512
+ epochs: number;
513
+ roundDuration: number;
514
+ validationSplit: number;
515
+ batchSize: number;
516
+ tensorBackend: "gpt" | "tfjs";
517
+ };
518
+ }, {
519
+ id: string;
520
+ displayInformation: {
521
+ title: string;
522
+ summary: {
523
+ preview: string;
524
+ overview: string;
525
+ };
526
+ dataFormatInformation?: string | undefined;
527
+ model?: string | undefined;
528
+ sampleDataset?: {
529
+ link: string;
530
+ instructions: string;
531
+ } | undefined;
532
+ };
533
+ trainingInformation: {
534
+ epochs: number;
535
+ roundDuration: number;
536
+ validationSplit: number;
537
+ batchSize: number;
538
+ tensorBackend: "gpt" | "tfjs";
539
+ };
540
+ }>, z.ZodUnion<[z.ZodObject<{
541
+ dataType: z.ZodLiteral<"image">;
542
+ displayInformation: z.ZodObject<{
543
+ dataExample: z.ZodOptional<z.ZodString>;
544
+ }, "strip", z.ZodTypeAny, {
545
+ dataExample?: string | undefined;
546
+ }, {
547
+ dataExample?: string | undefined;
548
+ }>;
549
+ trainingInformation: z.ZodObject<{
550
+ LABEL_LIST: z.ZodArray<z.ZodString, "many">;
551
+ IMAGE_W: z.ZodNumber;
552
+ IMAGE_H: z.ZodNumber;
553
+ }, "strip", z.ZodTypeAny, {
554
+ LABEL_LIST: string[];
555
+ IMAGE_W: number;
556
+ IMAGE_H: number;
557
+ }, {
558
+ LABEL_LIST: string[];
559
+ IMAGE_W: number;
560
+ IMAGE_H: number;
561
+ }>;
562
+ }, "strip", z.ZodTypeAny, {
563
+ displayInformation: {
564
+ dataExample?: string | undefined;
565
+ };
566
+ trainingInformation: {
567
+ LABEL_LIST: string[];
568
+ IMAGE_W: number;
569
+ IMAGE_H: number;
570
+ };
571
+ dataType: "image";
572
+ }, {
573
+ displayInformation: {
574
+ dataExample?: string | undefined;
575
+ };
576
+ trainingInformation: {
577
+ LABEL_LIST: string[];
578
+ IMAGE_W: number;
579
+ IMAGE_H: number;
580
+ };
581
+ dataType: "image";
582
+ }>, z.ZodObject<{
583
+ dataType: z.ZodLiteral<"tabular">;
584
+ displayInformation: z.ZodObject<{
585
+ dataExample: z.ZodOptional<z.ZodArray<z.ZodObject<{
586
+ name: z.ZodString;
587
+ data: z.ZodString;
588
+ }, "strip", z.ZodTypeAny, {
589
+ name: string;
590
+ data: string;
591
+ }, {
592
+ name: string;
593
+ data: string;
594
+ }>, "many">>;
595
+ }, "strip", z.ZodTypeAny, {
596
+ dataExample?: {
597
+ name: string;
598
+ data: string;
599
+ }[] | undefined;
600
+ }, {
601
+ dataExample?: {
602
+ name: string;
603
+ data: string;
604
+ }[] | undefined;
605
+ }>;
606
+ trainingInformation: z.ZodObject<{
607
+ inputColumns: z.ZodArray<z.ZodString, "many">;
608
+ outputColumn: z.ZodString;
609
+ }, "strip", z.ZodTypeAny, {
610
+ inputColumns: string[];
611
+ outputColumn: string;
612
+ }, {
613
+ inputColumns: string[];
614
+ outputColumn: string;
615
+ }>;
616
+ }, "strip", z.ZodTypeAny, {
617
+ displayInformation: {
618
+ dataExample?: {
619
+ name: string;
620
+ data: string;
621
+ }[] | undefined;
622
+ };
623
+ trainingInformation: {
624
+ inputColumns: string[];
625
+ outputColumn: string;
626
+ };
627
+ dataType: "tabular";
628
+ }, {
629
+ displayInformation: {
630
+ dataExample?: {
631
+ name: string;
632
+ data: string;
633
+ }[] | undefined;
634
+ };
635
+ trainingInformation: {
636
+ inputColumns: string[];
637
+ outputColumn: string;
638
+ };
639
+ dataType: "tabular";
640
+ }>, z.ZodObject<{
641
+ dataType: z.ZodLiteral<"text">;
642
+ displayInformation: z.ZodObject<{
643
+ dataExample: z.ZodOptional<z.ZodString>;
644
+ }, "strip", z.ZodTypeAny, {
645
+ dataExample?: string | undefined;
646
+ }, {
647
+ dataExample?: string | undefined;
648
+ }>;
649
+ trainingInformation: z.ZodObject<{
650
+ tokenizer: z.ZodType<import("../index.js").Tokenizer, z.ZodTypeDef, import("../index.js").Tokenizer>;
651
+ contextLength: z.ZodNumber;
652
+ }, "strip", z.ZodTypeAny, {
653
+ contextLength: number;
654
+ tokenizer: import("../index.js").Tokenizer;
655
+ }, {
656
+ contextLength: number;
657
+ tokenizer: import("../index.js").Tokenizer;
658
+ }>;
659
+ }, "strip", z.ZodTypeAny, {
660
+ displayInformation: {
661
+ dataExample?: string | undefined;
662
+ };
663
+ trainingInformation: {
664
+ contextLength: number;
665
+ tokenizer: import("../index.js").Tokenizer;
666
+ };
667
+ dataType: "text";
668
+ }, {
669
+ displayInformation: {
670
+ dataExample?: string | undefined;
671
+ };
672
+ trainingInformation: {
673
+ contextLength: number;
674
+ tokenizer: import("../index.js").Tokenizer;
675
+ };
676
+ dataType: "text";
677
+ }>]>>, z.ZodUnion<[z.ZodObject<{
678
+ trainingInformation: z.ZodIntersection<z.ZodObject<{
679
+ scheme: z.ZodLiteral<"decentralized">;
680
+ } & {
681
+ privacy: z.ZodOptional<z.ZodEffects<z.ZodObject<{
682
+ clippingRadius: z.ZodOptional<z.ZodNumber>;
683
+ noiseScale: z.ZodOptional<z.ZodNumber>;
684
+ }, "strip", z.ZodTypeAny, {
685
+ clippingRadius?: number | undefined;
686
+ noiseScale?: number | undefined;
687
+ }, {
688
+ clippingRadius?: number | undefined;
689
+ noiseScale?: number | undefined;
690
+ }>, {
691
+ clippingRadius?: number | undefined;
692
+ noiseScale?: number | undefined;
693
+ } | undefined, {
694
+ clippingRadius?: number | undefined;
695
+ noiseScale?: number | undefined;
696
+ }>>;
697
+ minNbOfParticipants: z.ZodNumber;
698
+ }, "strip", z.ZodTypeAny, {
699
+ scheme: "decentralized";
700
+ minNbOfParticipants: number;
701
+ privacy?: {
702
+ clippingRadius?: number | undefined;
703
+ noiseScale?: number | undefined;
704
+ } | undefined;
705
+ }, {
706
+ scheme: "decentralized";
707
+ minNbOfParticipants: number;
708
+ privacy?: {
709
+ clippingRadius?: number | undefined;
710
+ noiseScale?: number | undefined;
711
+ } | undefined;
712
+ }>, z.ZodUnion<[z.ZodObject<{
713
+ aggregationStrategy: z.ZodLiteral<"mean">;
714
+ }, "strip", z.ZodTypeAny, {
715
+ aggregationStrategy: "mean";
716
+ }, {
717
+ aggregationStrategy: "mean";
718
+ }>, z.ZodObject<{
719
+ aggregationStrategy: z.ZodLiteral<"secure">;
720
+ maxShareValue: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
721
+ }, "strip", z.ZodTypeAny, {
722
+ aggregationStrategy: "secure";
723
+ maxShareValue: number;
724
+ }, {
725
+ aggregationStrategy: "secure";
726
+ maxShareValue?: number | undefined;
727
+ }>]>>;
728
+ }, "strip", z.ZodTypeAny, {
729
+ trainingInformation: {
730
+ scheme: "decentralized";
731
+ minNbOfParticipants: number;
732
+ privacy?: {
733
+ clippingRadius?: number | undefined;
734
+ noiseScale?: number | undefined;
735
+ } | undefined;
736
+ } & ({
737
+ aggregationStrategy: "mean";
738
+ } | {
739
+ aggregationStrategy: "secure";
740
+ maxShareValue: number;
741
+ });
742
+ }, {
743
+ trainingInformation: {
744
+ scheme: "decentralized";
745
+ minNbOfParticipants: number;
746
+ privacy?: {
747
+ clippingRadius?: number | undefined;
748
+ noiseScale?: number | undefined;
749
+ } | undefined;
750
+ } & ({
751
+ aggregationStrategy: "mean";
752
+ } | {
753
+ aggregationStrategy: "secure";
754
+ maxShareValue?: number | undefined;
755
+ });
756
+ }>, z.ZodObject<{
757
+ trainingInformation: z.ZodObject<{
758
+ scheme: z.ZodLiteral<"federated">;
759
+ aggregationStrategy: z.ZodLiteral<"mean">;
760
+ } & {
761
+ privacy: z.ZodOptional<z.ZodEffects<z.ZodObject<{
762
+ clippingRadius: z.ZodOptional<z.ZodNumber>;
763
+ noiseScale: z.ZodOptional<z.ZodNumber>;
764
+ }, "strip", z.ZodTypeAny, {
765
+ clippingRadius?: number | undefined;
766
+ noiseScale?: number | undefined;
767
+ }, {
768
+ clippingRadius?: number | undefined;
769
+ noiseScale?: number | undefined;
770
+ }>, {
771
+ clippingRadius?: number | undefined;
772
+ noiseScale?: number | undefined;
773
+ } | undefined, {
774
+ clippingRadius?: number | undefined;
775
+ noiseScale?: number | undefined;
776
+ }>>;
777
+ minNbOfParticipants: z.ZodNumber;
778
+ }, "strip", z.ZodTypeAny, {
779
+ scheme: "federated";
780
+ minNbOfParticipants: number;
781
+ aggregationStrategy: "mean";
782
+ privacy?: {
783
+ clippingRadius?: number | undefined;
784
+ noiseScale?: number | undefined;
785
+ } | undefined;
786
+ }, {
787
+ scheme: "federated";
788
+ minNbOfParticipants: number;
789
+ aggregationStrategy: "mean";
790
+ privacy?: {
791
+ clippingRadius?: number | undefined;
792
+ noiseScale?: number | undefined;
793
+ } | undefined;
794
+ }>;
795
+ }, "strip", z.ZodTypeAny, {
796
+ trainingInformation: {
797
+ scheme: "federated";
798
+ minNbOfParticipants: number;
799
+ aggregationStrategy: "mean";
800
+ privacy?: {
801
+ clippingRadius?: number | undefined;
802
+ noiseScale?: number | undefined;
803
+ } | undefined;
804
+ };
805
+ }, {
806
+ trainingInformation: {
807
+ scheme: "federated";
808
+ minNbOfParticipants: number;
809
+ aggregationStrategy: "mean";
810
+ privacy?: {
811
+ clippingRadius?: number | undefined;
812
+ noiseScale?: number | undefined;
813
+ } | undefined;
814
+ };
815
+ }>, z.ZodObject<{
816
+ trainingInformation: z.ZodObject<{
817
+ scheme: z.ZodLiteral<"local">;
818
+ aggregationStrategy: z.ZodLiteral<"mean">;
819
+ }, "strip", z.ZodTypeAny, {
820
+ scheme: "local";
821
+ aggregationStrategy: "mean";
822
+ }, {
823
+ scheme: "local";
824
+ aggregationStrategy: "mean";
825
+ }>;
826
+ }, "strip", z.ZodTypeAny, {
827
+ trainingInformation: {
828
+ scheme: "local";
829
+ aggregationStrategy: "mean";
830
+ };
831
+ }, {
832
+ trainingInformation: {
833
+ scheme: "local";
834
+ aggregationStrategy: "mean";
835
+ };
836
+ }>]>>;
9
837
  }
10
- export declare function isTaskID(obj: unknown): obj is TaskID;
11
- export declare function isTask(raw: unknown): raw is Task<DataType>;
838
+ export type Task<D extends DataType, N extends Network> = z.infer<typeof Task.baseSchema> & z.infer<(typeof Task.dataTypeToSchema)[D]> & z.infer<(typeof Task.networkToSchema)[N]>;