learning_model 1.0.18 → 1.0.22

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 (40) hide show
  1. package/README.md +5 -1
  2. package/jest.config.js +6 -0
  3. package/lib/learning/mobilenet_image.test.ts +44 -0
  4. package/{src → lib}/learning/mobilenet_image.ts +3 -1
  5. package/lib/learning/util.ts +15 -0
  6. package/package.json +5 -4
  7. package/tsconfig.json +4 -6
  8. package/dist/index.bundle.js +0 -2
  9. package/dist/index.bundle.js.LICENSE.txt +0 -335
  10. package/dist/index.js +0 -10
  11. package/dist/types/index.d.ts +0 -3
  12. package/dist/types/learning/base.d.ts +0 -19
  13. package/dist/types/learning/base.js +0 -2
  14. package/dist/types/learning/image.d.ts +0 -40
  15. package/dist/types/learning/image.js +0 -259
  16. package/dist/types/learning/mobilenet_image.d.ts +0 -42
  17. package/dist/types/learning/mobilenet_image.js +0 -262
  18. package/dist/types/learning/mobilenet_image.test.d.ts +0 -1
  19. package/dist/types/public/index.d.ts +0 -1
  20. package/dist/types/src/index.d.ts +0 -3
  21. package/dist/types/src/learning/base.d.ts +0 -19
  22. package/dist/types/src/learning/image.d.ts +0 -40
  23. package/dist/types/src/learning/mobilenet_image.d.ts +0 -42
  24. package/public/index.css +0 -7
  25. package/public/index.html +0 -15
  26. package/public/index.ts +0 -153
  27. package/src/learning/mobilenet_image.test.ts +0 -63
  28. package/types/index.d.ts +0 -3
  29. package/types/learning/base.d.ts +0 -19
  30. package/types/learning/image.d.ts +0 -40
  31. package/types/learning/mobilenet_image.d.ts +0 -42
  32. package/types/learning/mobilenet_image.test.d.ts +0 -1
  33. package/types/public/index.d.ts +0 -1
  34. package/types/src/index.d.ts +0 -3
  35. package/types/src/learning/base.d.ts +0 -19
  36. package/types/src/learning/image.d.ts +0 -40
  37. package/types/src/learning/mobilenet_image.d.ts +0 -42
  38. /package/{src → lib}/index.ts +0 -0
  39. /package/{src → lib}/learning/base.ts +0 -0
  40. /package/{src → lib}/learning/image.ts +0 -0
@@ -1,19 +0,0 @@
1
- import * as tf from '@tensorflow/tfjs';
2
- interface LearningInterface {
3
- model: tf.LayersModel | null;
4
- labels: string[];
5
- isRunning: boolean;
6
- isReady: boolean;
7
- onProgress(progress: number): void;
8
- onLoss(loss: number): void;
9
- onEvents(logs: any): void;
10
- onTrainBegin(log: any): void;
11
- onTrainEnd(log: any): void;
12
- addData(label: string, data: any): Promise<void>;
13
- train(): Promise<tf.History>;
14
- infer(data: any): Promise<any>;
15
- saveModel(): void;
16
- running(): boolean;
17
- ready(): boolean;
18
- }
19
- export default LearningInterface;
@@ -1,40 +0,0 @@
1
- import * as tf from '@tensorflow/tfjs';
2
- import LearningInterface from './base';
3
- declare class LearningImage implements LearningInterface {
4
- model: tf.LayersModel | null;
5
- epochs: number;
6
- batchSize: number;
7
- learningRate: number;
8
- labels: string[];
9
- isRunning: boolean;
10
- isReady: boolean;
11
- limitSize: number;
12
- trainImages: tf.Tensor3D[];
13
- readonly MOBILE_NET_INPUT_WIDTH = 224;
14
- readonly MOBILE_NET_INPUT_HEIGHT = 224;
15
- readonly MOBILE_NET_INPUT_CHANNEL = 3;
16
- readonly IMAGE_NORMALIZATION_FACTOR = 255;
17
- constructor({ epochs, batchSize, limitSize, learningRate, }?: {
18
- modelURL?: string;
19
- epochs?: number;
20
- batchSize?: number;
21
- limitSize?: number;
22
- learningRate?: number;
23
- });
24
- onProgress: (progress: number) => void;
25
- onLoss: (loss: number) => void;
26
- onEvents: (logs: any) => void;
27
- onTrainBegin: (log: any) => void;
28
- onTrainEnd: (log: any) => void;
29
- addData(label: string, data: any): Promise<void>;
30
- train(): Promise<tf.History>;
31
- infer(data: any): Promise<Map<string, number>>;
32
- saveModel(): void;
33
- running(): boolean;
34
- ready(): boolean;
35
- private _preprocessedTargetData;
36
- private _preprocessedInputData;
37
- private _preprocessData;
38
- private _createModel;
39
- }
40
- export default LearningImage;
@@ -1,42 +0,0 @@
1
- import * as tf from '@tensorflow/tfjs';
2
- import LearningInterface from './base';
3
- declare class LearningMobilenetImage implements LearningInterface {
4
- model: tf.LayersModel | null;
5
- epochs: number;
6
- batchSize: number;
7
- learningRate: number;
8
- labels: string[];
9
- modelURL: string;
10
- isRunning: boolean;
11
- isReady: boolean;
12
- limitSize: number;
13
- trainImages: tf.Tensor3D[];
14
- readonly MOBILE_NET_INPUT_WIDTH = 224;
15
- readonly MOBILE_NET_INPUT_HEIGHT = 224;
16
- readonly MOBILE_NET_INPUT_CHANNEL = 3;
17
- readonly IMAGE_NORMALIZATION_FACTOR = 255;
18
- constructor({ modelURL, // 디폴트 mobilenet 이미지
19
- epochs, batchSize, limitSize, learningRate, }?: {
20
- modelURL?: string;
21
- epochs?: number;
22
- batchSize?: number;
23
- limitSize?: number;
24
- learningRate?: number;
25
- });
26
- onProgress: (progress: number) => void;
27
- onLoss: (loss: number) => void;
28
- onEvents: (logs: any) => void;
29
- onTrainBegin: (log: any) => void;
30
- onTrainEnd: (log: any) => void;
31
- addData(label: string, data: any): Promise<void>;
32
- train(): Promise<tf.History>;
33
- infer(data: any): Promise<Map<string, number>>;
34
- saveModel(): void;
35
- running(): boolean;
36
- ready(): boolean;
37
- private _preprocessedTargetData;
38
- private _preprocessedInputData;
39
- private _preprocessData;
40
- private _createModel;
41
- }
42
- export default LearningMobilenetImage;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- import LearningImage from './learning/image';
2
- import LearningMobilenetImage from './learning/mobilenet_image';
3
- export { LearningImage, LearningMobilenetImage };
@@ -1,19 +0,0 @@
1
- import * as tf from '@tensorflow/tfjs';
2
- interface LearningInterface {
3
- model: tf.LayersModel | null;
4
- labels: string[];
5
- isRunning: boolean;
6
- isReady: boolean;
7
- onProgress(progress: number): void;
8
- onLoss(loss: number): void;
9
- onEvents(logs: any): void;
10
- onTrainBegin(log: any): void;
11
- onTrainEnd(log: any): void;
12
- addData(label: string, data: any): Promise<void>;
13
- train(): Promise<tf.History>;
14
- infer(data: any): Promise<any>;
15
- saveModel(): void;
16
- running(): boolean;
17
- ready(): boolean;
18
- }
19
- export default LearningInterface;
@@ -1,40 +0,0 @@
1
- import * as tf from '@tensorflow/tfjs';
2
- import LearningInterface from './base';
3
- declare class LearningImage implements LearningInterface {
4
- model: tf.LayersModel | null;
5
- epochs: number;
6
- batchSize: number;
7
- learningRate: number;
8
- labels: string[];
9
- isRunning: boolean;
10
- isReady: boolean;
11
- limitSize: number;
12
- trainImages: tf.Tensor3D[];
13
- readonly MOBILE_NET_INPUT_WIDTH = 224;
14
- readonly MOBILE_NET_INPUT_HEIGHT = 224;
15
- readonly MOBILE_NET_INPUT_CHANNEL = 3;
16
- readonly IMAGE_NORMALIZATION_FACTOR = 255;
17
- constructor({ epochs, batchSize, limitSize, learningRate, }?: {
18
- modelURL?: string;
19
- epochs?: number;
20
- batchSize?: number;
21
- limitSize?: number;
22
- learningRate?: number;
23
- });
24
- onProgress: (progress: number) => void;
25
- onLoss: (loss: number) => void;
26
- onEvents: (logs: any) => void;
27
- onTrainBegin: (log: any) => void;
28
- onTrainEnd: (log: any) => void;
29
- addData(label: string, data: any): Promise<void>;
30
- train(): Promise<tf.History>;
31
- infer(data: any): Promise<Map<string, number>>;
32
- saveModel(): void;
33
- running(): boolean;
34
- ready(): boolean;
35
- private _preprocessedTargetData;
36
- private _preprocessedInputData;
37
- private _preprocessData;
38
- private _createModel;
39
- }
40
- export default LearningImage;
@@ -1,42 +0,0 @@
1
- import * as tf from '@tensorflow/tfjs';
2
- import LearningInterface from './base';
3
- declare class LearningMobilenetImage implements LearningInterface {
4
- model: tf.LayersModel | null;
5
- epochs: number;
6
- batchSize: number;
7
- learningRate: number;
8
- labels: string[];
9
- modelURL: string;
10
- isRunning: boolean;
11
- isReady: boolean;
12
- limitSize: number;
13
- trainImages: tf.Tensor3D[];
14
- readonly MOBILE_NET_INPUT_WIDTH = 224;
15
- readonly MOBILE_NET_INPUT_HEIGHT = 224;
16
- readonly MOBILE_NET_INPUT_CHANNEL = 3;
17
- readonly IMAGE_NORMALIZATION_FACTOR = 255;
18
- constructor({ modelURL, // 디폴트 mobilenet 이미지
19
- epochs, batchSize, limitSize, learningRate, }?: {
20
- modelURL?: string;
21
- epochs?: number;
22
- batchSize?: number;
23
- limitSize?: number;
24
- learningRate?: number;
25
- });
26
- onProgress: (progress: number) => void;
27
- onLoss: (loss: number) => void;
28
- onEvents: (logs: any) => void;
29
- onTrainBegin: (log: any) => void;
30
- onTrainEnd: (log: any) => void;
31
- addData(label: string, data: any): Promise<void>;
32
- train(): Promise<tf.History>;
33
- infer(data: any): Promise<Map<string, number>>;
34
- saveModel(): void;
35
- running(): boolean;
36
- ready(): boolean;
37
- private _preprocessedTargetData;
38
- private _preprocessedInputData;
39
- private _preprocessData;
40
- private _createModel;
41
- }
42
- export default LearningMobilenetImage;
File without changes
File without changes
File without changes