@epfml/discojs 2.1.2-p20240507140056.0 → 2.1.2-p20240513140724.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.
- package/README.md +24 -0
- package/dist/dataset/dataset_builder.js +1 -1
- package/dist/default_tasks/cifar10/index.js +3 -4
- package/dist/default_tasks/index.d.ts +0 -2
- package/dist/default_tasks/index.js +0 -2
- package/dist/default_tasks/lus_covid.js +3 -3
- package/dist/default_tasks/mnist.js +0 -1
- package/dist/default_tasks/simple_face/index.js +0 -2
- package/dist/default_tasks/titanic.js +0 -1
- package/dist/default_tasks/wikitext.js +2 -3
- package/dist/task/display_information.d.ts +3 -6
- package/dist/task/display_information.js +21 -10
- package/dist/task/index.d.ts +0 -1
- package/dist/task/index.js +0 -1
- package/package.json +1 -1
- package/dist/default_tasks/geotags/index.d.ts +0 -2
- package/dist/default_tasks/geotags/index.js +0 -65
- package/dist/default_tasks/geotags/model.d.ts +0 -593
- package/dist/default_tasks/geotags/model.js +0 -4715
- package/dist/default_tasks/skin_mnist.d.ts +0 -2
- package/dist/default_tasks/skin_mnist.js +0 -80
- package/dist/task/label_type.d.ts +0 -9
- package/dist/task/label_type.js +0 -28
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import * as tf from '@tensorflow/tfjs';
|
|
2
|
-
import { data, models } from '../index.js';
|
|
3
|
-
export const skinMnist = {
|
|
4
|
-
getTask() {
|
|
5
|
-
return {
|
|
6
|
-
id: 'skin_mnist',
|
|
7
|
-
displayInformation: {
|
|
8
|
-
taskTitle: 'Skin disease classification',
|
|
9
|
-
summary: {
|
|
10
|
-
preview: 'Can you determine the skin disease from the dermatoscopic images?',
|
|
11
|
-
overview: 'HAM10000 "Human Against Machine with 10000 training images" dataset is a large collection of multi-source dermatoscopic images of pigmented lesions from Kaggle'
|
|
12
|
-
},
|
|
13
|
-
limitations: 'The training data is limited to small images of size 28x28, similarly to the MNIST dataset.',
|
|
14
|
-
tradeoffs: 'Training success strongly depends on label distribution',
|
|
15
|
-
dataFormatInformation: '',
|
|
16
|
-
dataExampleText: 'Below you find an example',
|
|
17
|
-
dataExampleImage: 'http://walidbn.com/ISIC_0024306.jpg'
|
|
18
|
-
},
|
|
19
|
-
trainingInformation: {
|
|
20
|
-
modelID: 'skin_mnist-model',
|
|
21
|
-
epochs: 50,
|
|
22
|
-
roundDuration: 1,
|
|
23
|
-
validationSplit: 0.1,
|
|
24
|
-
batchSize: 32,
|
|
25
|
-
preprocessingFunctions: [data.ImagePreprocessing.Normalize],
|
|
26
|
-
dataType: 'image',
|
|
27
|
-
IMAGE_H: 28,
|
|
28
|
-
IMAGE_W: 28,
|
|
29
|
-
LABEL_LIST: [
|
|
30
|
-
'Melanocytic nevi',
|
|
31
|
-
'Melanoma',
|
|
32
|
-
'Benign keratosis-like lesions',
|
|
33
|
-
'Basal cell carcinoma',
|
|
34
|
-
'Actinic keratoses',
|
|
35
|
-
'Vascular lesions',
|
|
36
|
-
'Dermatofibroma'
|
|
37
|
-
],
|
|
38
|
-
scheme: 'federated',
|
|
39
|
-
noiseScale: undefined,
|
|
40
|
-
clippingRadius: undefined
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
getModel() {
|
|
45
|
-
const numClasses = 7;
|
|
46
|
-
const size = 28;
|
|
47
|
-
const model = tf.sequential();
|
|
48
|
-
model.add(tf.layers.conv2d({
|
|
49
|
-
inputShape: [size, size, 3],
|
|
50
|
-
filters: 256,
|
|
51
|
-
kernelSize: 3,
|
|
52
|
-
activation: 'relu'
|
|
53
|
-
}));
|
|
54
|
-
model.add(tf.layers.maxPooling2d({ poolSize: [2, 2] }));
|
|
55
|
-
model.add(tf.layers.dropout({ rate: 0.3 }));
|
|
56
|
-
model.add(tf.layers.conv2d({
|
|
57
|
-
filters: 128,
|
|
58
|
-
kernelSize: 3,
|
|
59
|
-
activation: 'relu'
|
|
60
|
-
}));
|
|
61
|
-
model.add(tf.layers.maxPooling2d({ poolSize: [2, 2] }));
|
|
62
|
-
model.add(tf.layers.dropout({ rate: 0.3 }));
|
|
63
|
-
model.add(tf.layers.conv2d({
|
|
64
|
-
filters: 64,
|
|
65
|
-
kernelSize: 3,
|
|
66
|
-
activation: 'relu'
|
|
67
|
-
}));
|
|
68
|
-
model.add(tf.layers.maxPooling2d({ poolSize: [2, 2] }));
|
|
69
|
-
model.add(tf.layers.dropout({ rate: 0.3 }));
|
|
70
|
-
model.add(tf.layers.flatten());
|
|
71
|
-
model.add(tf.layers.dense({ units: 32 }));
|
|
72
|
-
model.add(tf.layers.dense({ units: numClasses, activation: 'softmax' }));
|
|
73
|
-
model.compile({
|
|
74
|
-
optimizer: tf.train.adam(0.001),
|
|
75
|
-
loss: 'categoricalCrossentropy',
|
|
76
|
-
metrics: ['accuracy']
|
|
77
|
-
});
|
|
78
|
-
return Promise.resolve(new models.TFJS(model));
|
|
79
|
-
}
|
|
80
|
-
};
|
package/dist/task/label_type.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export var LabelTypeEnum;
|
|
2
|
-
(function (LabelTypeEnum) {
|
|
3
|
-
LabelTypeEnum[LabelTypeEnum["TEXT"] = 0] = "TEXT";
|
|
4
|
-
LabelTypeEnum[LabelTypeEnum["POLYGON_MAP"] = 1] = "POLYGON_MAP";
|
|
5
|
-
})(LabelTypeEnum || (LabelTypeEnum = {}));
|
|
6
|
-
function isLabelTypeEnum(raw) {
|
|
7
|
-
switch (raw) {
|
|
8
|
-
case LabelTypeEnum.TEXT: break;
|
|
9
|
-
case LabelTypeEnum.POLYGON_MAP: break;
|
|
10
|
-
default: return false;
|
|
11
|
-
}
|
|
12
|
-
const _ = raw;
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
export function isLabelType(raw) {
|
|
16
|
-
if (typeof raw !== 'object' || raw === null) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
const { labelType, mapBaseUrl } = raw;
|
|
20
|
-
if (!isLabelTypeEnum(labelType) ||
|
|
21
|
-
(mapBaseUrl !== undefined && typeof mapBaseUrl !== 'string')) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
const repack = { labelType, mapBaseUrl };
|
|
25
|
-
const _correct = repack;
|
|
26
|
-
const _total = repack;
|
|
27
|
-
return true;
|
|
28
|
-
}
|