-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
117 changed files
with
16,636 additions
and
9,577 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,247 @@ | ||
//#region YI | ||
|
||
import { YArg } from "@syls/y/arg"; | ||
import { YEntity } from "@syls/y/entity"; | ||
import { configAi as config } from "./config.mjs"; | ||
import { YLayer } from "../-submodule/layer/-module/class.mjs"; | ||
import { YLayerInput } from "../-submodule/layer/-heir/layerInput/-module/class.mjs"; | ||
import { YLayerOutput } from "../-submodule/layer/-heir/layerOutput/-module/class.mjs"; | ||
|
||
//#endregion | ||
//#region YT | ||
|
||
/** ### aiTC | ||
* @typedef aiTC | ||
* @prop {} | ||
*/ | ||
|
||
/** @typedef {import('./module.mjs').aiT&aiTC} aiT */ | ||
|
||
//#endregion | ||
|
||
/** | ||
* ### YNN | ||
* | ||
* Класс нейронных сетей. | ||
* | ||
* *** | ||
* @class | ||
* @since `1.0.0` | ||
* @version `1.0.0` | ||
* | ||
*/ | ||
export class YNN extends YEntity { | ||
|
||
//#region static | ||
|
||
static { | ||
|
||
this | ||
|
||
.appendModule(this) | ||
|
||
}; | ||
|
||
/** | ||
* ### stock | ||
* | ||
* *** | ||
* | ||
* | ||
* | ||
* *** | ||
* @type {YNN[]} | ||
* @field | ||
* @static | ||
* @public | ||
*/ | ||
static stock = []; | ||
/** | ||
* ### config | ||
* | ||
* | ||
* | ||
* *** | ||
* @field | ||
* @static | ||
* @public | ||
*/ | ||
static config = config; | ||
|
||
/** | ||
* @arg {...YNN} args `Аргументы` | ||
* @returns {YNN[]} | ||
*/ | ||
static create(...args) { | ||
|
||
return super.create(...args); | ||
|
||
}; | ||
/** | ||
* @arg {Y1} value `Значение` | ||
* @static | ||
* @method | ||
* @public | ||
* @returns {(Y1&YNN)?} | ||
* @template {YNN} Y1 | ||
* @override | ||
*/ | ||
static setClass(value) { | ||
|
||
return super.setClass(value); | ||
|
||
}; | ||
|
||
//#endregion | ||
//#region field | ||
|
||
/** | ||
* ### layers | ||
* | ||
* Слои. | ||
* | ||
* *** | ||
* @since `1.0.0` | ||
* @type {YLayer[]} | ||
* @field | ||
* @public | ||
*/ | ||
layers; | ||
|
||
//#endregion | ||
//#region method | ||
|
||
/** | ||
* @method | ||
* @public | ||
* @override | ||
*/ | ||
getClass() { | ||
|
||
return YNN; | ||
|
||
}; | ||
|
||
/** | ||
* ### appendLayer | ||
* | ||
* Метод добавления слоёв. | ||
* | ||
* Каждый слой размещается в соотвествии с порядком их добавления. | ||
* | ||
* Важно учитывать ряд правил по использованию метода: | ||
* 1. Первым слоем всегда указывается `input` слой. | ||
* 2. Послденим слоем всегда указывается `output` слой. | ||
* 3. Сеть может содержать только один `input` и `output` слой. | ||
* | ||
* *** | ||
* @arg {...[aiT['layerType'], number]} layers `Слои` | ||
* | ||
* | ||
* *** | ||
* @since `1.0.0` | ||
* @version `1.0.0` | ||
* @method | ||
* @public | ||
*/ | ||
appendLayer(...layers) { | ||
|
||
for (let layer of layers) { | ||
|
||
switch (layer[0]) { | ||
|
||
case 'input': layer = new YLayerInput(...layer); break; | ||
case 'output': layer = new YLayerOutput(...layer); break; | ||
|
||
}; | ||
|
||
this.layers.push(layer); | ||
|
||
}; | ||
|
||
return this; | ||
|
||
}; | ||
|
||
//#endregion | ||
|
||
/** | ||
* ### YNNConstructor | ||
* - Версия `1.0.0` | ||
* | ||
* | ||
* *** | ||
* | ||
* | ||
* | ||
* *** | ||
* | ||
* @arg {aiTC} args `Аргументы` | ||
* | ||
* Представлены единым объектом носителем аргументов. | ||
* | ||
* *** | ||
* @since `1.0.0` | ||
* @public | ||
* @version `1.0.0` | ||
* @constructor | ||
*/ | ||
constructor(...args) { | ||
|
||
try { | ||
|
||
//#region before | ||
|
||
/** @type {YArg<YNN>} */ | ||
const yarg = args instanceof YArg ? args : new YArg(args); | ||
|
||
|
||
|
||
super(yarg); | ||
|
||
//#endregion | ||
//#region verify | ||
|
||
|
||
|
||
//#endregion | ||
//#region handle | ||
|
||
|
||
|
||
//#endregion | ||
//#region comply | ||
|
||
|
||
|
||
//#endregion | ||
|
||
return this | ||
|
||
.adopt(yarg.getData()) | ||
|
||
|
||
} catch (err) { | ||
|
||
if (config.params.strictMode) { | ||
|
||
throw err; | ||
|
||
}; | ||
|
||
} finally { | ||
|
||
|
||
|
||
}; | ||
|
||
}; | ||
|
||
}; | ||
|
||
/** | ||
* @file ai/class.mjs | ||
* @author Yakhin Nikita Artemovich <[email protected]> | ||
* @license Apache-2.0 | ||
* @copyright SYLS (Software Y Lib Solutions) 2023 | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { YConfig } from "@syls/y/config"; | ||
import { configEntity } from "@syls/y/entity"; | ||
|
||
/** @type {configEntity['params']} */ | ||
const config = { | ||
|
||
|
||
|
||
}; | ||
|
||
/** ### configAi | ||
* | ||
* Конфигуратор модуля `ai`. | ||
* | ||
* *** | ||
* @since `1.0.0` | ||
* @version `1.0.0` | ||
* @public | ||
*/ | ||
export const configAi = new YConfig({ | ||
|
||
...config, | ||
|
||
/** | ||
* ### layersDefault | ||
* | ||
* Дефолт слои. | ||
* | ||
* *** | ||
* @since `1.0.0` | ||
* @type {any} | ||
* @public | ||
* @property | ||
*/ | ||
layersDefault: [], | ||
|
||
}, configEntity); | ||
|
||
export default configAi; | ||
|
||
/** | ||
* @file ai/config.mjs | ||
* @author Yakhin Nikita Artemovich <[email protected]> | ||
* @license Apache-2.0 | ||
* @copyright SYLS (Software Y Lib Solutions) 2023 | ||
*/ |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//#region YI | ||
|
||
import { YArg } from '@syls/y/arg'; | ||
import { YCond } from '@syls/y/cond'; | ||
import { configAi as config } from './config.mjs'; | ||
|
||
//#endregion | ||
//#region YT | ||
|
||
/** ### aiT | ||
* | ||
* Типы модуля `ai`. | ||
* | ||
* @typedef aiT | ||
* @prop {'conv'|'pool'|'input'|'output'|'fullcon'|'activation'} layerType | ||
* | ||
*/ | ||
|
||
//#endregion | ||
//#region YV | ||
|
||
|
||
|
||
//#endregion | ||
|
||
|
||
|
||
/** | ||
* @file ai/module.mjs | ||
* @author Yakhin Nikita Artemovich <[email protected]> | ||
* @license Apache-2.0 | ||
* @copyright SYLS (Software Y Lib Solutions) 2023 | ||
*/ |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./export.mjs"; |
File renamed without changes.
Oops, something went wrong.