Skip to content

Commit

Permalink
0.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MrYNikita committed Nov 20, 2023
1 parent 2efe188 commit a00e6bd
Show file tree
Hide file tree
Showing 117 changed files with 16,636 additions and 9,577 deletions.
File renamed without changes.
247 changes: 247 additions & 0 deletions -submodule/ai/-module/class.mjs
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
*/
46 changes: 46 additions & 0 deletions -submodule/ai/-module/config.mjs
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.
33 changes: 33 additions & 0 deletions -submodule/ai/-module/module.mjs
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.
1 change: 1 addition & 0 deletions -submodule/ai/-module/type.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./export.mjs";
Loading

0 comments on commit a00e6bd

Please sign in to comment.