repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
nythonore/mlabs-blog
src/domain/blog/interfaces.ts
export interface BlogInterface { id: number; userId: number; title: string; body: string; } export interface StateInterface { data: BlogInterface[]; loading: boolean; error: string | null; }
nythonore/mlabs-blog
src/domain/blog/reducer.ts
import { StateInterface } from './interfaces'; import { enumType, actionType } from './types'; const initialState = { data: [], loading: false, error: null, }; const reducer = ( state: StateInterface = initialState, action: actionType ): StateInterface => { switch (action.type) { case enumType.REQUEST_LIST_BL...
nythonore/mlabs-blog
src/domain/reducers.ts
<reponame>nythonore/mlabs-blog import { combineReducers } from 'redux'; import blogReducer from './blog/reducer'; const reducers = combineReducers({ blog: blogReducer, }); export type rootState = ReturnType<typeof reducers>; export default reducers;
nythonore/mlabs-blog
src/resources/components/Search.tsx
<gh_stars>0 import { useDispatch } from 'react-redux'; import { Form } from 'react-bootstrap'; import { listBlog } from '../../domain/blog/actions'; const Search = () => { const dispatch = useDispatch(); return ( <div className='quick-search'> <Form.Group> <Form.Control type='text' name='search' ...
nythonore/mlabs-blog
src/domain/blog/actions.ts
<reponame>nythonore/mlabs-blog import axios from 'axios'; import { Dispatch } from 'redux'; import { enumType, actionType } from './types'; const BASE_URL = 'https://jsonplaceholder.typicode.com/posts'; export const listBlog = (q: string | undefined = undefined) => { return async (dispatch: Dispatch<actionType>) => ...
nythonore/mlabs-blog
src/Routes.tsx
import { Navigate, useRoutes } from 'react-router-dom'; import BlogListView from './resources/views/BlogListView'; const Routes = () => { return useRoutes([ { path: '/', element: <BlogListView /> }, { path: '*', element: <Navigate to='/' /> }, ]); }; export default Routes;
nythonore/mlabs-blog
src/domain/blog/types.ts
import { BlogInterface } from './interfaces'; export enum enumType { REQUEST_LIST_BLOG_LOADING = 'REQUEST_LIST_BLOG_LOADING', REQUEST_LIST_BLOG_SUCCESS = 'REQUEST_LIST_BLOG_SUCCESS', REQUEST_LIST_BLOG_ERROR = 'REQUEST_LIST_BLOG_ERROR', } interface actionLoading { type: enumType.REQUEST_LIST_BLOG_LOADING; } inter...
nythonore/mlabs-blog
src/resources/components/Blog.tsx
import React from 'react'; import { Row, Col, Image } from 'react-bootstrap'; import { trimText } from '../../core/helpers/utils'; import { BlogInterface } from '../../domain/blog/interfaces'; type Props = { data: BlogInterface; }; const Blog = ({ data }: Props) => { return ( <div className='blog-card cursor shad...
nythonore/mlabs-blog
src/core/helpers/utils.ts
export const trimText = (text: string = '', length: number = 8) => { if (text.length > length) return `${text.slice(0, length)}...`; return text; };
nythonore/mlabs-blog
src/core/hooks/useTypedSelector.ts
import { useSelector, TypedUseSelectorHook } from 'react-redux'; import { rootState } from '../../domain/reducers'; const useTypedSelector: TypedUseSelectorHook<rootState> = useSelector; export default useTypedSelector;
IAmVisco/despair-bot
src/helpers/consts.ts
import * as pkg from '../../package.json'; import * as triggers from '../../triggers.json'; import { StatsCommand } from '../types'; export const BOT_VERSION = pkg.version; export const BOT_DESCRIPTION = pkg.description; export const GITHUB_LINK = pkg.repository; export const KEYWORDS: StatsCommand[] = triggers.map((...
IAmVisco/despair-bot
src/services/EmbedFactoryService.ts
import { MessageEmbed, ClientUser } from 'discord.js'; import * as moment from 'moment-timezone'; import { BOT_VERSION } from '../helpers/consts'; class EmbedFactoryService { getEmbedBase(user: ClientUser | null, title: string): MessageEmbed { const embed = new MessageEmbed() .setTitle(title) .setAut...
IAmVisco/despair-bot
src/helpers/redis.ts
<filename>src/helpers/redis.ts import * as Redis from 'ioredis'; const redis = new Redis(process.env.REDIS_PORT); redis.config('SET', 'notify-keyspace-events', 'KEA'); export { redis };
IAmVisco/despair-bot
src/commands/meta.ts
import * as moment from 'moment-timezone'; import * as path from 'path'; import { BOT_DESCRIPTION, GITHUB_LINK } from '../helpers/consts'; import { embedFactory } from '../services/EmbedFactoryService'; import { redisCollectorService } from '../services/RedisCollectorService'; import { Command } from '../types'; const...
IAmVisco/despair-bot
src/commands/stats.ts
import * as moment from 'moment-timezone'; import * as path from 'path'; import type { MessageEmbed } from 'discord.js'; import { contextMessageBody, dictionaryMessageBody, KEYWORDS } from '../helpers/consts'; import { redis } from '../helpers/redis'; import { embedFactory } from '../services/EmbedFactoryService'; impo...
IAmVisco/despair-bot
src/services/RedisCollectorService.ts
import { logger } from '../helpers/logger'; import { redis } from '../helpers/redis'; import { KEYWORDS } from '../helpers/consts'; class RedisCollectorService { async getKeyValue(key: string): Promise<number> { return parseInt(await redis.get(key) || '0', 10); } countKeywords(content: string): void { t...
nurdiansyah/version-bump-prompt
src/normalize-options.ts
import * as globby from "globby"; import { hasMagic } from "globby"; import { isReleaseType, ReleaseType } from "./release-type"; import { VersionBumpOptions } from "./types/version-bump-options"; interface Interface { input?: NodeJS.ReadableStream | NodeJS.ReadStream | false; output?: NodeJS.WritableStream | Node...
nurdiansyah/version-bump-prompt
src/get-old-version.ts
import * as semver from "semver"; import { readJsonFile } from "./fs"; import { isManifest } from "./manifest"; import { Operation } from "./operation"; /** * Finds the current version number from files such as package.json. * An error is thrown if no version number can be found. */ export async function getOldVers...
nurdiansyah/version-bump-prompt
src/release-type.ts
<gh_stars>100-1000 import { ReleaseType } from "semver"; export { ReleaseType }; /** * The different types of pre-releases. */ export const prereleaseTypes: ReleaseType[] = ["premajor", "preminor", "prepatch", "prerelease"]; /** * All possible release types. */ export const releaseTypes: ReleaseType[] = prerelea...
nurdiansyah/version-bump-prompt
src/types/version-bump-progress.ts
<reponame>nurdiansyah/version-bump-prompt import { VersionBumpResults } from "./version-bump-results"; /** * Progress events that indicate the progress of the `versionBump()` function. */ export const enum ProgressEvent { FileUpdated = "file updated", FileSkipped = "file skipped", GitCommit = "git commit", G...
nurdiansyah/version-bump-prompt
src/cli/parse-args.ts
import * as commandLineArgs from "command-line-args"; import * as semver from "semver"; import { isReleaseType } from "../release-type"; import { VersionBumpOptions } from "../types/version-bump-options"; import { ExitCode } from "./exit-code"; import { usageText } from "./help"; /** * The parsed command-line argumen...
nurdiansyah/version-bump-prompt
dist/index.d.ts
<filename>dist/index.d.ts import versionBump from "@jsdevtools/version-bump-prompt"; export * from "@jsdevtools/version-bump-prompt"; export default versionBump;
nurdiansyah/version-bump-prompt
src/index.ts
import { versionBump } from "./version-bump"; // Exprot the external type definitions as named exports export { ReleaseType } from "./release-type"; export * from "./types/version-bump-options"; export * from "./types/version-bump-results"; export * from "./types/version-bump-progress"; // Export `versionBump` as a n...
nurdiansyah/version-bump-prompt
src/get-new-version.ts
<gh_stars>100-1000 import * as inquirer from "inquirer"; import * as semver from "semver"; import { ReleaseType, SemVer } from "semver"; import { BumpRelease, PromptRelease } from "./normalize-options"; import { Operation } from "./operation"; import { isPrerelease, releaseTypes } from "./release-type"; /** * Determi...
nurdiansyah/version-bump-prompt
src/run-npm-script.ts
<reponame>nurdiansyah/version-bump-prompt<gh_stars>100-1000 import * as ezSpawn from "@jsdevtools/ez-spawn"; import { readJsonFile } from "./fs"; import { isManifest, Manifest } from "./manifest"; import { Operation } from "./operation"; import { NpmScript, ProgressEvent } from "./types/version-bump-progress"; /** * ...
nurdiansyah/version-bump-prompt
src/version-bump.ts
import { getNewVersion } from "./get-new-version"; import { getOldVersion } from "./get-old-version"; import { gitCommit, gitPush, gitTag } from "./git"; import { Operation } from "./operation"; import { runNpmScript } from "./run-npm-script"; import { VersionBumpOptions } from "./types/version-bump-options"; import { ...
nurdiansyah/version-bump-prompt
src/types/version-bump-results.ts
import { ReleaseType } from "../release-type"; /** * Information about the work that was performed by the `versionBump()` function. */ export interface VersionBumpResults { /** * The release type that was used, or `undefined` if an explicit version number was used. */ release?: ReleaseType; /** * The...
nurdiansyah/version-bump-prompt
src/git.ts
import * as ezSpawn from "@jsdevtools/ez-spawn"; import { Operation } from "./operation"; import { ProgressEvent } from "./types/version-bump-progress"; /** * Commits the modififed files to Git, if the `commit` option is enabled. */ export async function gitCommit(operation: Operation): Promise<Operation> { if (!o...
nurdiansyah/version-bump-prompt
src/cli/help.ts
<reponame>nurdiansyah/version-bump-prompt import { manifest } from "../manifest"; /** * Text explaining how to use the CLI */ export const usageText = ` Usage: bump [release] [options] [files...] release: The release version or type. Can be one of the following: - A semver version number (ex: 1.23.456) - p...
nurdiansyah/version-bump-prompt
src/manifest.ts
<reponame>nurdiansyah/version-bump-prompt<gh_stars>100-1000 // NOTE: We can't `import` the package.json file because it's outside of the "src" directory. // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires const manifest = require("../package.json") as Manifest; export...
balovbohdan/fwd-ann
src/lib/calculators/output-errors/calc-errors-with-teacher.ts
import {Matrix} from 'matrix-calculus'; import { OutputErrors } from './types'; import { Signals, SignalsErrors } from '../../signals'; type Data = { output:Signals; idealOutput:Signals; }; const calcErrorsMatrix = ({ output, idealOutput }:Data):Matrix => { const outputMatrix:Matrix = output.getMatrix();...
balovbohdan/fwd-ann
dist/lib/ann/create.d.ts
import { ANN } from './ANN'; import * as T from './types'; import { T as TLayers } from '../layers'; import { T as TLayersPairsWeights } from '../weights/layers-pairs-weights'; import { Params as RndWeightParams } from '../weights/layers-pair-weights/rnd/create-rnd-weight'; declare type Data = { id?: string | null;...
balovbohdan/fwd-ann
src/lib/teacher/types.ts
import { ANN } from '../ann'; import { Signals } from '../signals'; export type Result = { ann:ANN; log:Log; }; export type Log = Array<{epoch:number, cycle:number, RootMSE:number}>; export type PreparedParams = { epoches:number; }; export type Params = { epoches?:number; }; export type Data = { ...
balovbohdan/fwd-ann
dist/lib/calculators/ann-output/calc-ann-output.d.ts
import { ANN } from '../../ann'; import { Signals } from '../../signals'; export declare type Res = { output: Signals; layersInputs: Array<Signals>; layersOutputs: Array<Signals>; }; declare type Data = { ann: ANN; signals: Signals; }; declare const calcAnnOutput: ({ ann, signals }: Data) => Promise...
balovbohdan/fwd-ann
src/lib/calculators/ann-output/weights-to-signals.ts
<filename>src/lib/calculators/ann-output/weights-to-signals.ts import { Matrix } from 'matrix-calculus'; import { Signals } from '../../signals'; import { Weights } from '../../weights/layers-pair-weights'; type Data = { weights:Weights; signals:Signals; }; const weightsToSignals = (data:Data):Signals => { ...
balovbohdan/fwd-ann
src/lib/ann/create.ts
<reponame>balovbohdan/fwd-ann import { ANN } from './ANN'; import * as T from './types'; import createLayers, { T as TLayers } from '../layers'; import createLayersPairsWeights from '../weights/layers-pairs-weights'; import { T as TLayersPairsWeights } from '../weights/layers-pairs-weights'; import { Params as RndWeigh...
balovbohdan/fwd-ann
src/lib/weights/layers-pairs-weights/create.ts
import { Matrix } from 'matrix-calculus'; import { DirtyData } from './types'; import { LayersWeights } from './LayersWeights'; import { Weights } from '../layers-pair-weights'; const create = (data:DirtyData):LayersWeights => { const weights = createWeights(data); return new LayersWeights(weights); }; cons...
balovbohdan/fwd-ann
src/lib/layers/Layers.ts
import * as T from './types'; import { Units } from '../units'; export class Layers { constructor(layers:T.LayersData) { this.layers = layers; } getOutputLayer():Units|never { const num = this.getQty(); const lastIndex = num - 1; const layer = this.layers[lastIndex]; ...
balovbohdan/fwd-ann
dist/lib/weights/layers-pairs-weights/rnd/create-rnd-layers-weights-from-layers-raw-data.d.ts
import { T as TLayers } from '../../../layers'; import { LayersWeights } from '../LayersWeights'; import { Params as RndWeightsParams } from '../../layers-pair-weights/rnd/create-rnd-weight'; declare type Params = { layersData: TLayers.LayersRawData; rndWeightParams?: RndWeightsParams; }; declare const createRn...
balovbohdan/fwd-ann
dist/lib/ann/index.d.ts
<filename>dist/lib/ann/index.d.ts import * as T from './types'; export { T }; export { ANN } from './ANN'; export { default } from './create';
balovbohdan/fwd-ann
dist/lib/teacher/Teacher.d.ts
import * as T from './types'; export declare class Teacher { static teach(data: T.Data, params?: T.Params): Promise<T.Result>; private constructor(); private teach; private doTeach; private startCycle; private static prepareParams; private log; private readonly ann; private readonly ...
balovbohdan/fwd-ann
src/lib/signals/index.ts
export { Signals } from './Signals'; export { Mutator } from './mutators'; export { SignalsErrors } from './SignalsErrors';
balovbohdan/fwd-ann
dist/lib/calculators/back-error-propagation/calc-updated-weights.d.ts
<gh_stars>0 import { ANN } from '../../ann'; import { LayersPair } from '../../layers/types'; import { Signals, SignalsErrors } from '../../signals'; import { Weights } from '../../weights/layers-pair-weights'; declare type Data = { ann: ANN; errors: SignalsErrors; layersPair: LayersPair; layersOutputs:...
balovbohdan/fwd-ann
dist/lib/weights/layers-pair-weights/rnd/create-rnd-weights.d.ts
import { Weights } from '../Weights'; import { Params as RndWeightParams } from './create-rnd-weight'; export declare type Params = { leftUnitsQty: number; rightUnitsQty: number; rndWeightParams?: RndWeightParams; }; declare const createRndWeights: (params: Params) => Weights | null; export default createRn...
balovbohdan/fwd-ann
dist/lib/calculators/output-errors/calc-errors-with-teacher.d.ts
<gh_stars>0 import { OutputErrors } from './types'; import { Signals } from '../../signals'; declare type Data = { output: Signals; idealOutput: Signals; }; declare const calcErrorsWithTeacher: ({ output, idealOutput }: Data) => Promise<OutputErrors>; export default calcErrorsWithTeacher;
balovbohdan/fwd-ann
src/lib/weights/layers-pair-weights/rnd/create-rnd-weight.ts
<gh_stars>0 import { assignDeep } from '../../../../utils/object-utils'; import { floating } from '../../../../utils/math-utils/random-number'; export type Params = { min?:number; max?:number; leftUnitsQty?:number; rightUnitsQty?:number; exclude?:Array<number>; }; type ParamsPrepared = { min:n...
balovbohdan/fwd-ann
src/lib/signals/mutators.ts
<reponame>balovbohdan/fwd-ann import { Signals } from './Signals'; import { funcs } from 'math-funcs-calculus'; export type Mutator = (signals:Signals, Func?:Func)=>Signals; type Func = { calc:Function; }; const { Logistic, RationalSigmoid } = funcs; export const mutator:Mutator = (signals:Signals, Func:Func = ...
balovbohdan/fwd-ann
src/lib/calculators/back-error-propagation/calc-layers-output-errors.ts
import { ANN } from '../../ann'; import { SignalsErrors } from '../../signals'; import calcLayerOutputErrors from './calc-layer-output-errors'; export type Res = Array<SignalsErrors>|null; type Data = { ann:ANN; outputErrors:SignalsErrors|null; }; const calcLayersOutputErrors = async ({ ann, outputErrors }:D...
balovbohdan/fwd-ann
dist/lib/units/Units.d.ts
<reponame>balovbohdan/fwd-ann import * as T from './types'; import { Unit } from './Unit'; import { Signals } from '../signals'; import { LayerType } from '../layers'; import { ActivationFunction } from '../activation-funcs'; export declare class Units { constructor(data: T.UnitsRaw); getNames(): Array<string>;...
balovbohdan/fwd-ann
src/lib/signals/normalize.ts
<filename>src/lib/signals/normalize.ts import { Signals } from './Signals'; import { rationalSigmoid, Mutator } from './mutators'; const normalize = (signals:Signals, mutator:Mutator|null = rationalSigmoid):Signals => (mutator || rationalSigmoid)(signals); export default normalize;
balovbohdan/fwd-ann
dist/lib/layers/types.d.ts
<reponame>balovbohdan/fwd-ann import { Units } from '../units'; import { Data as LayerData } from '../units/create'; export declare type LayersPair = { left: Units; right: Units; index: number; }; export declare type LayersData = Array<Units>; export declare type LayersRawData = Readonly<ReadonlyArray<Layer...
balovbohdan/fwd-ann
src/lib/units/Units.ts
<reponame>balovbohdan/fwd-ann<filename>src/lib/units/Units.ts import * as T from './types'; import { Unit } from './Unit'; import { Signals } from '../signals'; import { LayerType } from '../layers'; import { ActivationFunction } from '../activation-funcs'; import { decimal } from '../../utils/math-utils/random-number'...
balovbohdan/fwd-ann
dist/lib/calculators/back-error-propagation/calc-layer-output-errors.d.ts
import { ANN } from '../../ann'; import { Units } from '../../units'; import { SignalsErrors } from '../../signals'; declare type Data = { ann: ANN; aimLayer: Units; layersPairIndex: number | null; nextLayerOutputErrors: SignalsErrors; }; declare const calcLayerOutputErrors: (data: Data) => SignalsError...
balovbohdan/fwd-ann
src/utils/id-generator.ts
const generate = (length:number = 10):string => { const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; let txt = ''; for (let i = 0; i < length; i++) { txt += possible.charAt( Math.floor( Math.random() * possible.length ) ...
balovbohdan/fwd-ann
dist/lib/signals/mutators.d.ts
<filename>dist/lib/signals/mutators.d.ts import { Signals } from './Signals'; export declare type Mutator = (signals: Signals, Func?: Func) => Signals; declare type Func = { calc: Function; }; export declare const mutator: Mutator; export declare const logistic: (signals: Signals) => Signals; export declare const r...
balovbohdan/fwd-ann
src/lib/layers/index.ts
import * as T from './types'; export { T }; export { Layers } from './Layers'; export { default } from './create'; export { LayerName } from './LayerName'; export { LayerType } from './LayerType';
balovbohdan/fwd-ann
src/lib/signals/Signals.ts
import { matrixFactories, Matrix } from 'matrix-calculus'; import normalize from './normalize'; import { Mutator } from './mutators'; import { clone } from '../../utils/object-utils'; const { SingleColMatrixFactory } = matrixFactories; export class Signals { static create(signals:Array<number>, names:Array<strin...
balovbohdan/fwd-ann
src/lib/layers/create.ts
<gh_stars>0 import * as T from './types'; import { Layers } from './Layers'; import createUnits from '../units/create'; const create = (data:T.LayersRawData):Layers => { const layersRawData = makeData(data); return new Layers(layersRawData); }; const makeData = (data:T.LayersRawData):T.LayersData => { co...
balovbohdan/fwd-ann
dist/lib/layers/create.d.ts
<filename>dist/lib/layers/create.d.ts import { Layers } from './Layers'; declare const create: (data: readonly import("../units/create").Data[]) => Layers; export default create;
balovbohdan/fwd-ann
dist/config.d.ts
<filename>dist/config.d.ts declare const config: Readonly<{ ann: { defParams: { learningSpeed: number; inputSignals: { offset: number; needOffset: boolean; needNormalize: boolean; normalizer: (signals: import(".").Signal...
balovbohdan/fwd-ann
dist/lib/calculators/back-error-propagation/calc-updated-layers-weights.d.ts
<reponame>balovbohdan/fwd-ann import { ANN } from '../../ann'; import { Signals, SignalsErrors } from '../../signals'; import { LayersWeights } from '../../weights/layers-pairs-weights'; declare type Data = { ann: ANN; input: Signals; errors: SignalsErrors | null; }; declare const calcUpdatedLayersWeights: ...
balovbohdan/fwd-ann
src/utils/math-utils/arithmetic-average.ts
type Calculator = (numbers:Array<number>)=>number; export const simple = (values:Array<number>):number => { const len = values.length; if (len <= 0) throw new ArithmeticAverageError('Failed to calc "Simple Arithmetic Average" value. Got empty numbers array.'); try { return values.reduce((...
balovbohdan/fwd-ann
src/lib/weights/layers-pairs-weights/LayersWeights.ts
import * as T from './types'; import { Weights } from '../layers-pair-weights'; export class LayersWeights { constructor(layersWeights:T.Data) { this.weights = layersWeights; } get(layersPairIndex:number|null):Weights|null { return layersPairIndex === null ? null : ...
balovbohdan/fwd-ann
dist/lib/calculators/back-error-propagation/calc-theta.d.ts
<gh_stars>0 import { Matrix } from 'matrix-calculus'; import { Signals } from '../../signals'; import { LayersPair } from '../../layers/types'; declare type Data = { output: Signals; layersPair: LayersPair; }; declare const calcTheta: ({ output, layersPair }: Data) => Matrix; export default calcTheta;
balovbohdan/fwd-ann
dist/utils/object-utils.d.ts
<filename>dist/utils/object-utils.d.ts export declare const clone: <T extends object>(obj: T) => T; export declare const assignDeep: <T extends object>(target: object, source: object, concatArrays?: boolean) => T; export declare const freezeDeep: <T extends Object>(obj: { [key: string]: any; } & T) => Readonly<T>;
balovbohdan/fwd-ann
src/lib/calculators/back-error-propagation/calc-updated-layers-weights.ts
<filename>src/lib/calculators/back-error-propagation/calc-updated-layers-weights.ts import { ANN, T as TANN } from '../../ann'; import { Signals, SignalsErrors } from '../../signals'; import calcUpdatedWeights from './calc-updated-weights'; import { LayersWeights, T as TLayersWeights } from '../../weights/layers-pairs-...
balovbohdan/fwd-ann
src/utils/math-utils/number-capacity.ts
<filename>src/utils/math-utils/number-capacity.ts export const getCapacity = (n:number):number => sign(n) * Math.abs(Math.floor(n)).toString().length; export const getCapacityBase = (capacity:number):number => capacity === 1 ? 1 : Math.pow(10, capacity); export const getNumberByCapacity = (cap...
balovbohdan/fwd-ann
dist/lib/calculators/back-error-propagation/calc-layers-output-errors.d.ts
import { ANN } from '../../ann'; import { SignalsErrors } from '../../signals'; export declare type Res = Array<SignalsErrors> | null; declare type Data = { ann: ANN; outputErrors: SignalsErrors | null; }; declare const calcLayersOutputErrors: ({ ann, outputErrors }: Data) => Promise<Res>; export default calcLa...
balovbohdan/fwd-ann
src/examples/numbers.ts
import createANN from '../lib/ann'; import { Signals } from '../lib/signals'; import { Teacher } from '../lib/teacher'; import { LayerType } from '../lib/layers'; import { activationFuncs } from '../lib/activation-funcs'; const { ReLU } = activationFuncs; const config = { ann: { params: { lear...
balovbohdan/fwd-ann
src/config.ts
<reponame>balovbohdan/fwd-ann import { freezeDeep } from './utils/object-utils'; import { rationalSigmoid } from './lib/signals/mutators'; const config = freezeDeep({ ann: { defParams: { learningSpeed: 1, inputSignals: { offset: .1, needOffset: true, ...
balovbohdan/fwd-ann
src/lib/units/types.ts
import { Unit } from './Unit'; import { LayerType } from '../layers'; export type UnitsData = Array<Unit>; export type UnitsRaw = { name?:string; type:LayerType; units:UnitsData; };
balovbohdan/fwd-ann
dist/lib/calculators/ann-output/calc-layers-pair.d.ts
import { ANN } from '../../ann'; import { Signals } from '../../signals'; import { LayersPair } from '../../layers/types'; declare type Data = { ann: ANN; signals: Signals; layersPair: LayersPair; }; declare type Res = { dirtyOutput: Signals; layersInputs: Array<Signals>; layersOutputs: Array<Si...
balovbohdan/fwd-ann
dist/utils/math-utils/numbers-collection-alias.d.ts
<filename>dist/utils/math-utils/numbers-collection-alias.d.ts export declare const encode: (numbers: number[]) => number; export declare const decode: (cipher: number) => number[];
balovbohdan/fwd-ann
src/lib/weights/layers-pairs-weights/rnd/create-rnd-layers-weights.ts
import { LayersWeights } from '../LayersWeights'; import { Weights } from '../../layers-pair-weights'; import createRndWeights, { Params as RndWeightsParams } from '../../layers-pair-weights/rnd/create-rnd-weights'; export type Params = Array<RndWeightsParams>; const createRndLayersWeightsData = (params:Params):Array...
balovbohdan/fwd-ann
src/utils/math-utils/random-number.ts
import { assignDeep } from '../object-utils'; import * as capacityUtils from './number-capacity'; type ValidParams = { exclude?:Array<number>; }; type FloatingParams = { min?:number; max?:number; exclude?:Array<number>; }; type DecimalParameterizedParams = { min?:number; max?:number; excl...
balovbohdan/fwd-ann
src/lib/teacher/Teacher.ts
<reponame>balovbohdan/fwd-ann<gh_stars>0 import { errors } from 'math-funcs-calculus'; import { ANN } from '../ann'; import * as T from './types'; import config from '../../config'; import { assignDeep } from '../../utils/object-utils'; import calcErrorsWithTeacher from '../calculators/output-errors/calc-errors-with-t...
balovbohdan/fwd-ann
dist/lib/weights/layers-pair-weights/Weights.d.ts
<reponame>balovbohdan/fwd-ann<filename>dist/lib/weights/layers-pair-weights/Weights.d.ts import { Matrix } from 'matrix-calculus'; export declare class Weights { constructor(weights: Matrix); getMatrix(): Matrix; private readonly weights; }
balovbohdan/fwd-ann
src/utils/math-utils/aaw.ts
// 'Arithmetic Average Weighted' calculator. import { clone } from '../object-utils'; type Data = { values:Array<number>; weights:Array<number>; }; const calc = (weights:Array<number>, values:Array<number>) => { const { weights: w, values: v } = prepareData(weights, values); if (w.length === 0) ...
balovbohdan/fwd-ann
dist/lib/ann/ANN.d.ts
<filename>dist/lib/ann/ANN.d.ts import * as T from './types'; import { Layers } from '../layers'; import { Signals } from '../signals'; import { LayersWeights } from '../weights/layers-pairs-weights'; export declare class ANN { constructor(data: T.Data, params?: T.Params); getId(): string | null; setId(id: ...
balovbohdan/fwd-ann
src/lib/calculators/back-error-propagation/calc-updated-weights.ts
import { Matrix } from 'matrix-calculus'; import { ANN } from '../../ann'; import { LayersPair } from '../../layers/types'; import calcDeltaWeights from './calc-delta-weights'; import { Signals, SignalsErrors } from '../../signals'; import { Weights } from '../../weights/layers-pair-weights'; type Data = { ann:AN...
balovbohdan/fwd-ann
dist/lib/weights/layers-pairs-weights/utils.d.ts
<gh_stars>0 import { LayersWeights } from './LayersWeights'; export declare const isIdentical: (left: LayersWeights, right: LayersWeights) => Promise<boolean>; export declare const hasTheSameSizeStrict: (left: LayersWeights, right: LayersWeights) => boolean; export declare const hasTheSameSize: (left: LayersWeights, ri...
balovbohdan/fwd-ann
src/lib/calculators/back-error-propagation/calc-theta.ts
// https://docs.google.com/document/d/1DSlzdK0LM1GqxDPES9GFLvuniNYoJNe5kEUfMS4FWsM import { Matrix } from 'matrix-calculus'; import { Signals } from '../../signals'; import { LayersPair } from '../../layers/types'; type Data = { output:Signals; layersPair:LayersPair; }; const calcTheta = ({ output, layersPa...
balovbohdan/fwd-ann
dist/lib/weights/layers-pair-weights/rnd/create-rnd-weight.d.ts
<filename>dist/lib/weights/layers-pair-weights/rnd/create-rnd-weight.d.ts export declare type Params = { min?: number; max?: number; leftUnitsQty?: number; rightUnitsQty?: number; exclude?: Array<number>; }; declare const createRndWeight: (params: Params) => number; export default createRndWeight;
balovbohdan/fwd-ann
src/lib/activation-funcs/index.ts
import { ActivationFunction } from './types'; import * as activationFuncs from './activation-funcs'; export default activationFuncs; export { activationFuncs, ActivationFunction };
balovbohdan/fwd-ann
src/lib/calculators/output-errors/types.ts
<reponame>balovbohdan/fwd-ann import {SignalsErrors} from '../../signals'; export type OutputErrors = { errors:SignalsErrors|null; };
balovbohdan/fwd-ann
dist/utils/id-generator.d.ts
<reponame>balovbohdan/fwd-ann declare const generate: (length?: number) => string; export default generate;
balovbohdan/fwd-ann
src/lib/layers/types.ts
<reponame>balovbohdan/fwd-ann import { Units } from '../units'; import { Data as LayerData } from '../units/create'; export type LayersPair = { left:Units; right:Units; index:number; }; export type LayersData = Array<Units>; export type LayersRawData = Readonly<ReadonlyArray<LayerData>>;
balovbohdan/fwd-ann
dist/lib/calculators/back-error-propagation/calc-delta-weights.d.ts
<reponame>balovbohdan/fwd-ann<filename>dist/lib/calculators/back-error-propagation/calc-delta-weights.d.ts import { Matrix } from 'matrix-calculus'; import { ANN } from '../../ann'; import { LayersPair } from '../../layers/types'; import { Signals, SignalsErrors } from '../../signals'; declare type Data = { ann: AN...
balovbohdan/fwd-ann
dist/utils/math-utils/aaw.d.ts
<gh_stars>0 declare const calc: (weights: number[], values: number[]) => number; export default calc;
balovbohdan/fwd-ann
src/lib/calculators/ann-output/calc-layers-pair.ts
import { ANN } from '../../ann'; import { Signals } from '../../signals'; import { LayersPair } from '../../layers/types'; import weightsToSignals from './weights-to-signals'; type Data = { ann:ANN; signals:Signals; layersPair:LayersPair; }; type Res = { dirtyOutput:Signals; layersInputs:Array<Sig...
balovbohdan/fwd-ann
dist/lib/teacher/index.d.ts
<reponame>balovbohdan/fwd-ann import * as T from './types'; export { T }; export { Teacher } from './Teacher';
balovbohdan/fwd-ann
src/lib/weights/layers-pairs-weights/index.ts
<gh_stars>0 import * as T from './types'; export { T }; export { default } from './create'; export { LayersWeights } from './LayersWeights';
balovbohdan/fwd-ann
dist/lib/calculators/back-error-propagation/calc-delta.d.ts
import { Matrix } from 'matrix-calculus'; import { T } from '../../layers'; import { Signals, SignalsErrors } from '../../signals'; declare type Data = { output: Signals; errors: SignalsErrors; layersPair: T.LayersPair; }; declare const calcDelta: ({ output, errors, layersPair }: Data) => Matrix; export def...
balovbohdan/fwd-ann
src/lib/weights/layers-pairs-weights/rnd/create-params.ts
import { Params as Res } from './create-rnd-layers-weights'; import createWeightsParams from '../../layers-pair-weights/rnd/create-weights-params'; import { Params as RandomWeightParam } from '../../layers-pair-weights/rnd/create-rnd-weight'; import { LayersRawData } from '../../../layers/types'; export type Data = {...
balovbohdan/fwd-ann
src/index.ts
export { Signals } from './lib/signals'; export { Teacher } from './lib/teacher'; export { LayerType } from './lib/layers'; export { default, ANN } from './lib/ann'; export { activationFuncs } from './lib/activation-funcs';
balovbohdan/fwd-ann
src/lib/ann/types.ts
<gh_stars>0 import { Layers } from '../layers'; import { Mutator } from '../signals'; import { LayersWeights } from '../weights/layers-pairs-weights'; import { Res as AnnOutputCalculatorRes } from '../calculators/ann-output/calc-ann-output'; export type ComplexOutput = AnnOutputCalculatorRes; export type Params = { ...
balovbohdan/fwd-ann
src/lib/layers/LayerType.ts
<gh_stars>0 export enum LayerType { INPUT = 'input', HIDDEN = 'hidden', OUTPUT = 'output', }
balovbohdan/fwd-ann
src/lib/weights/layers-pair-weights/rnd/create-rnd-weights.ts
<reponame>balovbohdan/fwd-ann import { Matrix, Data as MatrixData } from 'matrix-calculus'; import { Weights } from '../Weights'; import createRndWeight, { Params as RndWeightParams } from './create-rnd-weight'; export type Params = { leftUnitsQty:number; rightUnitsQty:number; rndWeightParams?:RndWeightPa...
balovbohdan/fwd-ann
dist/lib/signals/Signals.d.ts
import { Matrix } from 'matrix-calculus'; import { Mutator } from './mutators'; export declare class Signals { static create(signals: Array<number>, names?: Array<string>): Signals; constructor(signals: Matrix, names?: Array<string>); getNames(): Array<string>; setNames(names: Array<string>): void; ...
balovbohdan/fwd-ann
src/lib/activation-funcs/types.ts
import { Matrix } from 'matrix-calculus'; export type ActivationFunction = { func:Func; calc:(n:number)=>number; calcComplexDerivative:(matrix:Matrix)=>Matrix; }; type Func = { calc: (n:number)=>number; };