manim-web 0.26.0 → 0.28.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/dist/animation/text/index.d.ts +2 -0
- package/dist/animation/text/index.d.ts.map +1 -0
- package/dist/animation/text/kineticTypography.d.ts +144 -0
- package/dist/animation/text/kineticTypography.d.ts.map +1 -0
- package/dist/audio/MidiInput.d.ts +159 -0
- package/dist/audio/MidiInput.d.ts.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/integrations/notebook.d.ts +117 -0
- package/dist/integrations/notebook.d.ts.map +1 -0
- package/dist/integrations/notebook.js +60 -0
- package/dist/integrations/react.js +17 -17
- package/dist/integrations/vue.js +16 -16
- package/dist/manim-web.browser.js +9117 -7786
- package/dist/mobjects/graphing/GanttChart.d.ts +179 -0
- package/dist/mobjects/graphing/GanttChart.d.ts.map +1 -0
- package/dist/mobjects/graphing/ganttLayout.d.ts +36 -0
- package/dist/mobjects/graphing/ganttLayout.d.ts.map +1 -0
- package/dist/mobjects/graphing/index.d.ts +1 -0
- package/dist/mobjects/graphing/index.d.ts.map +1 -1
- package/dist/mobjects/ml/ConvolutionalLayer.d.ts +19 -0
- package/dist/mobjects/ml/ConvolutionalLayer.d.ts.map +1 -0
- package/dist/mobjects/ml/EdgePulse.d.ts +30 -0
- package/dist/mobjects/ml/EdgePulse.d.ts.map +1 -0
- package/dist/mobjects/ml/FeedForwardLayer.d.ts +31 -0
- package/dist/mobjects/ml/FeedForwardLayer.d.ts.map +1 -0
- package/dist/mobjects/ml/ImageLayer.d.ts +29 -0
- package/dist/mobjects/ml/ImageLayer.d.ts.map +1 -0
- package/dist/mobjects/ml/NeuralNetwork.d.ts +69 -0
- package/dist/mobjects/ml/NeuralNetwork.d.ts.map +1 -0
- package/dist/mobjects/ml/NeuralNetworkLayer.d.ts +54 -0
- package/dist/mobjects/ml/NeuralNetworkLayer.d.ts.map +1 -0
- package/dist/mobjects/ml/PoolingLayer.d.ts +19 -0
- package/dist/mobjects/ml/PoolingLayer.d.ts.map +1 -0
- package/dist/mobjects/ml/featureMapStack.d.ts +25 -0
- package/dist/mobjects/ml/featureMapStack.d.ts.map +1 -0
- package/dist/mobjects/ml/forwardPass.d.ts +28 -0
- package/dist/mobjects/ml/forwardPass.d.ts.map +1 -0
- package/dist/mobjects/ml/index.d.ts +18 -0
- package/dist/mobjects/ml/index.d.ts.map +1 -0
- package/dist/mobjects/ml/mlStyles.d.ts +52 -0
- package/dist/mobjects/ml/mlStyles.d.ts.map +1 -0
- package/dist/mobjects/physics/PhysicsWorld.d.ts +83 -0
- package/dist/mobjects/physics/PhysicsWorld.d.ts.map +1 -0
- package/dist/mobjects/physics/bodies.d.ts +91 -0
- package/dist/mobjects/physics/bodies.d.ts.map +1 -0
- package/dist/mobjects/physics/builders.d.ts +59 -0
- package/dist/mobjects/physics/builders.d.ts.map +1 -0
- package/dist/mobjects/physics/collisions.d.ts +29 -0
- package/dist/mobjects/physics/collisions.d.ts.map +1 -0
- package/dist/mobjects/physics/constraints.d.ts +67 -0
- package/dist/mobjects/physics/constraints.d.ts.map +1 -0
- package/dist/mobjects/physics/index.d.ts +13 -0
- package/dist/mobjects/physics/index.d.ts.map +1 -0
- package/dist/mobjects/physics/vec2.d.ts +17 -0
- package/dist/mobjects/physics/vec2.d.ts.map +1 -0
- package/dist/mobjects/shader/ShaderMobject.d.ts +105 -0
- package/dist/mobjects/shader/ShaderMobject.d.ts.map +1 -0
- package/dist/mobjects/shader/index.d.ts +2 -0
- package/dist/mobjects/shader/index.d.ts.map +1 -0
- package/dist/mobjects/sketch/index.d.ts +5 -0
- package/dist/mobjects/sketch/index.d.ts.map +1 -0
- package/dist/mobjects/sketch/sketch.d.ts +30 -0
- package/dist/mobjects/sketch/sketch.d.ts.map +1 -0
- package/dist/{src-B2lipHn1.js → src-D7e_dgYz.js} +3340 -2009
- package/package.json +6 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { VGroup } from '../../core/VGroup';
|
|
2
|
+
import { VMobject } from '../../core/VMobject';
|
|
3
|
+
import { Rectangle } from '../geometry/Rectangle';
|
|
4
|
+
import { Line } from '../geometry/Line';
|
|
5
|
+
import { GanttTaskSpec } from './ganttLayout';
|
|
6
|
+
/** A time value, given either as a number or a Date. */
|
|
7
|
+
export type GanttTimeValue = number | Date;
|
|
8
|
+
/**
|
|
9
|
+
* One task on the timeline.
|
|
10
|
+
*/
|
|
11
|
+
export interface GanttTask {
|
|
12
|
+
/** Unique task name, used for labels and as a dependency reference. */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Start of the task (number or Date). */
|
|
15
|
+
start: GanttTimeValue;
|
|
16
|
+
/** End of the task (number or Date). */
|
|
17
|
+
end: GanttTimeValue;
|
|
18
|
+
/** Row key. Tasks that share a key share a row. Default: the task name. */
|
|
19
|
+
row?: string;
|
|
20
|
+
/** Explicit bar color. Default: cycled from the palette by row. */
|
|
21
|
+
color?: string;
|
|
22
|
+
/** Names of tasks this task depends on (for dependency arrows). */
|
|
23
|
+
dependencies?: string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Options for creating a GanttChart.
|
|
27
|
+
*/
|
|
28
|
+
export interface GanttChartOptions {
|
|
29
|
+
/** Tasks to render, top to bottom in row order. */
|
|
30
|
+
tasks: GanttTask[];
|
|
31
|
+
/** Visual width of the time axis. Default: 8 */
|
|
32
|
+
width?: number;
|
|
33
|
+
/** Height of each task bar. Default: 0.4 */
|
|
34
|
+
rowHeight?: number;
|
|
35
|
+
/** Vertical gap between rows. Default: 0.2 */
|
|
36
|
+
rowGap?: number;
|
|
37
|
+
/** Bar colors. Single color applies to all, array cycles by row. Default: palette. */
|
|
38
|
+
barColors?: string | readonly string[];
|
|
39
|
+
/** Fill opacity of the bars. Default: 0.9 */
|
|
40
|
+
barFillOpacity?: number;
|
|
41
|
+
/** Stroke width of the bar outline. Default: 1.5 */
|
|
42
|
+
barStrokeWidth?: number;
|
|
43
|
+
/** Color for the axis, ticks and labels. Default: WHITE */
|
|
44
|
+
axisColor?: string;
|
|
45
|
+
/** Whether to draw the time axis line and ticks. Default: true */
|
|
46
|
+
showTimeAxis?: boolean;
|
|
47
|
+
/** Explicit tick values on the time axis (overrides timeTickCount). */
|
|
48
|
+
timeTicks?: GanttTimeValue[];
|
|
49
|
+
/** Number of evenly spaced ticks when timeTicks is not given. Default: 5 */
|
|
50
|
+
timeTickCount?: number;
|
|
51
|
+
/** Formatter for a tick value. Default: ISO date for Date input, else the number. */
|
|
52
|
+
formatTime?: (value: number) => string;
|
|
53
|
+
/** Font size for the time-axis labels. Default: 18 */
|
|
54
|
+
timeLabelFontSize?: number;
|
|
55
|
+
/** Whether to draw the per-row task labels. Default: true */
|
|
56
|
+
showLabels?: boolean;
|
|
57
|
+
/** Font size for the task labels. Default: 18 */
|
|
58
|
+
labelFontSize?: number;
|
|
59
|
+
/** Whether to draw dependency arrows between tasks. Default: false */
|
|
60
|
+
showDependencies?: boolean;
|
|
61
|
+
/** Color for the dependency arrows. Default: WHITE */
|
|
62
|
+
dependencyColor?: string;
|
|
63
|
+
/** Stroke width of the dependency arrows. Default: 2 */
|
|
64
|
+
dependencyStrokeWidth?: number;
|
|
65
|
+
/** Optional "today" marker position (number or Date). */
|
|
66
|
+
today?: GanttTimeValue;
|
|
67
|
+
/** Color for the today marker. Default: RED */
|
|
68
|
+
todayColor?: string;
|
|
69
|
+
/** Stroke width of the today marker. Default: 2 */
|
|
70
|
+
todayStrokeWidth?: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* GanttChart - A project-timeline chart mobject.
|
|
74
|
+
*
|
|
75
|
+
* Each task is a horizontal bar that spans its start to its end on a shared time
|
|
76
|
+
* x-axis. Each task sits on one row. Tasks that share a `row` key share a row and
|
|
77
|
+
* may overlap. Optional dependency arrows point from a predecessor's end to a
|
|
78
|
+
* dependent task's start. An optional "today" marker draws a vertical line.
|
|
79
|
+
*
|
|
80
|
+
* Time values are numbers or Dates; a Date is read through getTime(). A task
|
|
81
|
+
* whose end is at or before its start keeps a minimum-width bar anchored at its
|
|
82
|
+
* start, so the bar count always equals the task count.
|
|
83
|
+
*
|
|
84
|
+
* The chart is a VGroup, so Create and FadeIn animate it directly.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const chart = new GanttChart({
|
|
89
|
+
* tasks: [
|
|
90
|
+
* { name: 'Design', start: 0, end: 3 },
|
|
91
|
+
* { name: 'Build', start: 3, end: 8, dependencies: ['Design'] },
|
|
92
|
+
* ],
|
|
93
|
+
* showDependencies: true,
|
|
94
|
+
* today: 5,
|
|
95
|
+
* });
|
|
96
|
+
* scene.play(new Create(chart));
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export declare class GanttChart extends VGroup {
|
|
100
|
+
/** The task bars, one per task, in task order. */
|
|
101
|
+
bars: VGroup;
|
|
102
|
+
/** The per-row task labels. */
|
|
103
|
+
taskLabels: VGroup;
|
|
104
|
+
/** The dependency arrows (empty unless showDependencies is set). */
|
|
105
|
+
dependencyArrows: VGroup;
|
|
106
|
+
/** The time axis line. */
|
|
107
|
+
timeAxis: VMobject;
|
|
108
|
+
/** The time-axis tick labels. */
|
|
109
|
+
timeLabels: VGroup;
|
|
110
|
+
/** The today marker, when a today value is given; otherwise null. */
|
|
111
|
+
todayMarker: Line | null;
|
|
112
|
+
protected _tasks: GanttTask[];
|
|
113
|
+
protected _width: number;
|
|
114
|
+
protected _rowHeight: number;
|
|
115
|
+
protected _rowGap: number;
|
|
116
|
+
protected _barColors: string[];
|
|
117
|
+
protected _barFillOpacity: number;
|
|
118
|
+
protected _barStrokeWidth: number;
|
|
119
|
+
protected _axisColor: string;
|
|
120
|
+
protected _showTimeAxis: boolean;
|
|
121
|
+
protected _timeTicks: number[] | null;
|
|
122
|
+
protected _timeTickCount: number;
|
|
123
|
+
protected _formatTime: (value: number) => string;
|
|
124
|
+
protected _timeLabelFontSize: number;
|
|
125
|
+
protected _showLabels: boolean;
|
|
126
|
+
protected _labelFontSize: number;
|
|
127
|
+
protected _showDependencies: boolean;
|
|
128
|
+
protected _dependencyColor: string;
|
|
129
|
+
protected _dependencyStrokeWidth: number;
|
|
130
|
+
protected _today: number | null;
|
|
131
|
+
protected _todayColor: string;
|
|
132
|
+
protected _todayStrokeWidth: number;
|
|
133
|
+
protected _specs: GanttTaskSpec[];
|
|
134
|
+
protected _rowKeys: string[];
|
|
135
|
+
protected _timeRange: [number, number];
|
|
136
|
+
protected _indexByName: Map<string, number>;
|
|
137
|
+
private _usesDates;
|
|
138
|
+
constructor(options: GanttChartOptions);
|
|
139
|
+
/** Default tick formatter: ISO date for Date input, else a trimmed number. */
|
|
140
|
+
private _defaultFormat;
|
|
141
|
+
/** Convert a time value to its x-coordinate on the time axis. */
|
|
142
|
+
valueToX(value: GanttTimeValue): number;
|
|
143
|
+
/** Y-coordinate of the center of row `rowIndex` (row 0 is topmost). */
|
|
144
|
+
rowCenterY(rowIndex: number): number;
|
|
145
|
+
/** Top y-coordinate of the chart area (above the top row). */
|
|
146
|
+
private _chartTop;
|
|
147
|
+
/** Create the horizontal time axis line below the bottom row. */
|
|
148
|
+
private _createTimeAxis;
|
|
149
|
+
/** Build one bar per task spec. */
|
|
150
|
+
private _createBars;
|
|
151
|
+
/** Build the time-axis tick labels. */
|
|
152
|
+
private _createTimeLabels;
|
|
153
|
+
/** The tick values along the time axis. */
|
|
154
|
+
private _tickValues;
|
|
155
|
+
/** Build one label per row, placed to the left of the chart. */
|
|
156
|
+
private _createTaskLabels;
|
|
157
|
+
/** Build an arrow from each dependency's end to the dependent task's start. */
|
|
158
|
+
private _createDependencyArrows;
|
|
159
|
+
/** Build the vertical today marker. */
|
|
160
|
+
private _createTodayMarker;
|
|
161
|
+
/** Get the group of task bars. */
|
|
162
|
+
getBars(): VGroup;
|
|
163
|
+
/** Get the bar for a task by name, or undefined when there is no such task. */
|
|
164
|
+
getBar(name: string): Rectangle | undefined;
|
|
165
|
+
/** Get the group of dependency arrows (empty unless showDependencies is set). */
|
|
166
|
+
getDependencyArrows(): VGroup;
|
|
167
|
+
/** Get the today marker, or null when no today value was given. */
|
|
168
|
+
getTodayMarker(): Line | null;
|
|
169
|
+
/** Get the time range as [min start, max end]. */
|
|
170
|
+
getTimeRange(): [number, number];
|
|
171
|
+
/** Get the number of rows. */
|
|
172
|
+
getRowCount(): number;
|
|
173
|
+
/** Get the task definitions. */
|
|
174
|
+
getTasks(): GanttTask[];
|
|
175
|
+
/** Get the visual width of the time axis. */
|
|
176
|
+
getChartWidth(): number;
|
|
177
|
+
copy(): GanttChart;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=GanttChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GanttChart.d.ts","sourceRoot":"","sources":["../../../src/mobjects/graphing/GanttChart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAKxC,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAEvB,wDAAwD;AACxD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,IAAI,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,KAAK,EAAE,cAAc,CAAC;IACtB,wCAAwC;IACxC,GAAG,EAAE,cAAc,CAAC;IACpB,2EAA2E;IAC3E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,YAAY,CAAC,EA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AQ,IAAI,SAAS,EAAE;IAIvB,6CAA6C;IAC7C,aAAa,IAAI,MAAM;IAId,IAAI,IAAI,UAAU;CA2B5B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { GanttTask, GanttTimeValue } from './GanttChart';
|
|
2
|
+
/** One resolved task, ready to render. */
|
|
3
|
+
export interface GanttTaskSpec {
|
|
4
|
+
/** Task name. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Start time as a number. */
|
|
7
|
+
startValue: number;
|
|
8
|
+
/** End time as a number. */
|
|
9
|
+
endValue: number;
|
|
10
|
+
/** Index of the row the task sits on. */
|
|
11
|
+
rowIndex: number;
|
|
12
|
+
/** Resolved bar color. */
|
|
13
|
+
color: string;
|
|
14
|
+
/** Names of the tasks this task depends on. */
|
|
15
|
+
dependencies: string[];
|
|
16
|
+
}
|
|
17
|
+
/** The resolved specs plus the distinct row keys, in row order. */
|
|
18
|
+
export interface GanttLayout {
|
|
19
|
+
/** One spec per task, in task order. */
|
|
20
|
+
specs: GanttTaskSpec[];
|
|
21
|
+
/** Distinct row keys, in first-appearance (top-to-bottom) order. */
|
|
22
|
+
rowKeys: string[];
|
|
23
|
+
}
|
|
24
|
+
/** Read a time value as a number. A Date is read through getTime(). */
|
|
25
|
+
export declare function toTimeNumber(value: GanttTimeValue): number;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve tasks into render specs and the ordered list of rows.
|
|
28
|
+
*
|
|
29
|
+
* The row key of a task is its `row`, or its name when `row` is absent, so a
|
|
30
|
+
* task without a row key gets its own row. Colors come from the task's own
|
|
31
|
+
* color, or the palette cycled by row index.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveGanttLayout(tasks: GanttTask[], palette: string[]): GanttLayout;
|
|
34
|
+
/** Time range as [min start, max end] across all specs. */
|
|
35
|
+
export declare function ganttTimeRange(specs: GanttTaskSpec[]): [number, number];
|
|
36
|
+
//# sourceMappingURL=ganttLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ganttLayout.d.ts","sourceRoot":"","sources":["../../../src/mobjects/graphing/ganttLayout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9D,0CAA0C;AAC1C,MAAM,WAAW,aAAa;IAC5B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,mEAAmE;AACnE,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,oEAAoE;IACpE,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW,CAwBrF;AAED,2DAA2D;AAC3D,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAWvE"}
|
|
@@ -33,6 +33,7 @@ export { CalendarHeatmap, GITHUB_GREENS, type CalendarHeatmapOptions, type Calen
|
|
|
33
33
|
export { CandlestickChart, type CandlestickChartOptions, type OHLC } from './CandlestickChart';
|
|
34
34
|
export { RadarChart, type RadarChartOptions } from './RadarChart';
|
|
35
35
|
export { WaterfallChart, type WaterfallChartOptions } from './WaterfallChart';
|
|
36
|
+
export { GanttChart, type GanttChartOptions, type GanttTask, type GanttTimeValue, } from './GanttChart';
|
|
36
37
|
export { PieChart, type PieChartOptions, DonutChart, type DonutChartOptions, computeSliceGeometry, type SliceGeometry, type LabelPosition, } from './PieChart';
|
|
37
38
|
export { Treemap, type TreemapOptions, type TreemapColorBy } from './Treemap';
|
|
38
39
|
export { computeTreemapLayout, squarify, treemapNodeValue, type TreemapNode, type TreemapRect, type TreemapTile, } from './treemapLayout';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/graphing/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,YAAY,EACZ,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,IAAI,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGhD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGtF,OAAO,EAAE,KAAK,2BAA2B,EAAE,KAAK,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAGjG,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAG/F,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG3E,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAGpF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtF,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGzE,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,E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AAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,GAAG,EACH,aAAa,EACb,GAAG,EACH,kBAAkB,EAClB,UAAU,EACV,MAAM,EACN,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAGtF,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NeuralNetworkLayer } from './NeuralNetworkLayer';
|
|
2
|
+
import { NodeStyleOptions } from './mlStyles';
|
|
3
|
+
export interface ConvolutionalLayerOptions {
|
|
4
|
+
/** Number of feature-map squares in the stack. Default: 3. Must be >= 0. */
|
|
5
|
+
numFeatureMaps?: number;
|
|
6
|
+
/** Side length of each square feature map. Default: 0.5. */
|
|
7
|
+
mapSize?: number;
|
|
8
|
+
/** Diagonal offset between adjacent squares. Default: 0.15. */
|
|
9
|
+
offset?: number;
|
|
10
|
+
/** Node style overrides for the squares. */
|
|
11
|
+
nodeStyle?: NodeStyleOptions;
|
|
12
|
+
}
|
|
13
|
+
export declare class ConvolutionalLayer extends NeuralNetworkLayer {
|
|
14
|
+
private readonly _width;
|
|
15
|
+
constructor(options?: ConvolutionalLayerOptions);
|
|
16
|
+
/** Horizontal extent of the feature-map stack, used for spacing. */
|
|
17
|
+
layerWidth(): number;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ConvolutionalLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConvolutionalLayer.d.ts","sourceRoot":"","sources":["../../../src/mobjects/ml/ConvolutionalLayer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EACL,gBAAgB,EAIjB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED,qBAAa,kBAAmB,SAAQ,kBAAkB;IACxD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,OAAO,GAAE,yBAA8B;IAgBnD,oEAAoE;IAC3D,UAAU,IAAI,MAAM;CAG9B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VMobject } from '../../core/VMobject';
|
|
2
|
+
import { Animation, AnimationOptions } from '../../animation/Animation';
|
|
3
|
+
export interface EdgePulseOptions extends AnimationOptions {
|
|
4
|
+
/** Color the line takes when fully active. Default: white. */
|
|
5
|
+
activationColor?: string;
|
|
6
|
+
/** Peak stroke opacity at full activation. Default: 1. */
|
|
7
|
+
peakOpacity?: number;
|
|
8
|
+
/** When true, the line fades back to its resting look at alpha 1. Default: false. */
|
|
9
|
+
restore?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class EdgePulse extends Animation {
|
|
12
|
+
/** The activation level set on the most recent interpolate call, 0 to 1. */
|
|
13
|
+
activation: number;
|
|
14
|
+
private readonly _activationColor;
|
|
15
|
+
private readonly _peakOpacity;
|
|
16
|
+
private readonly _restore;
|
|
17
|
+
private _baseOpacity;
|
|
18
|
+
private _baseColor;
|
|
19
|
+
constructor(line: VMobject, options?: EdgePulseOptions);
|
|
20
|
+
begin(): void;
|
|
21
|
+
interpolate(alpha: number): void;
|
|
22
|
+
finish(): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create an EdgePulse animation for one connection line.
|
|
26
|
+
* @param line - The connection line to animate.
|
|
27
|
+
* @param options - Activation color, peak opacity, restore and timing options.
|
|
28
|
+
*/
|
|
29
|
+
export declare function edgePulse(line: VMobject, options?: EdgePulseOptions): EdgePulse;
|
|
30
|
+
//# sourceMappingURL=EdgePulse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EdgePulse.d.ts","sourceRoot":"","sources":["../../../src/mobjects/ml/EdgePulse.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAIxE,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,8DAA8D;IAC9D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,SAAU,SAAQ,SAAS;IACtC,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAK;IAEvB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,UAAU,CAAc;gBAEpB,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAE,gBAAqB;IAWjD,KAAK,IAAI,IAAI;IAOtB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAYvB,MAAM,IAAI,IAAI;CAWxB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAE/E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { NeuralNetworkLayer } from './NeuralNetworkLayer';
|
|
2
|
+
import { NodeStyleOptions } from './mlStyles';
|
|
3
|
+
export interface FeedForwardLayerOptions {
|
|
4
|
+
/** Number of nodes (circles) in the column. Default: 3. Must be >= 0. */
|
|
5
|
+
numNodes?: number;
|
|
6
|
+
/** Radius of each node circle. Default: 0.25. */
|
|
7
|
+
nodeRadius?: number;
|
|
8
|
+
/** Vertical gap between the centers of adjacent nodes. Default: 0.7. */
|
|
9
|
+
nodeSpacing?: number;
|
|
10
|
+
/** Node style overrides. */
|
|
11
|
+
nodeStyle?: NodeStyleOptions;
|
|
12
|
+
}
|
|
13
|
+
export declare class FeedForwardLayer extends NeuralNetworkLayer {
|
|
14
|
+
private readonly _nodeRadius;
|
|
15
|
+
private readonly _nodeSpacing;
|
|
16
|
+
private readonly _nodeStyle;
|
|
17
|
+
constructor(options?: FeedForwardLayerOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Build `count` circles in a vertical column centered on the local origin.
|
|
20
|
+
* @param count - Number of circles to create (0 leaves the layer empty).
|
|
21
|
+
*/
|
|
22
|
+
private _buildNodes;
|
|
23
|
+
/** Get the radius of each node circle. */
|
|
24
|
+
getNodeRadius(): number;
|
|
25
|
+
/**
|
|
26
|
+
* Horizontal extent of the column (one circle wide), used for spacing.
|
|
27
|
+
* Stays positive even with zero nodes so the network can place an empty layer.
|
|
28
|
+
*/
|
|
29
|
+
layerWidth(): number;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=FeedForwardLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeedForwardLayer.d.ts","sourceRoot":"","sources":["../../../src/mobjects/ml/FeedForwardLayer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAIjB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,uBAAuB;IACtC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED,qBAAa,gBAAiB,SAAQ,kBAAkB;IACtD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;gBAEnC,OAAO,GAAE,uBAA4B;IAYjD;;;OAGG;IACH,OAAO,CAAC,WAAW;IAoBnB,0CAA0C;IAC1C,aAAa,IAAI,MAAM;IAIvB;;;OAGG;IACM,UAAU,IAAI,MAAM;CAG9B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { NeuralNetworkLayer } from './NeuralNetworkLayer';
|
|
2
|
+
import { NodeStyleOptions } from './mlStyles';
|
|
3
|
+
export interface ImageLayerOptions {
|
|
4
|
+
/** Number of pixel rows. Default: 3. Must be >= 0. */
|
|
5
|
+
rows?: number;
|
|
6
|
+
/** Number of pixel columns. Default: 3. Must be >= 0. */
|
|
7
|
+
cols?: number;
|
|
8
|
+
/** Side length of each pixel cell. Default: 0.25. */
|
|
9
|
+
cellSize?: number;
|
|
10
|
+
/** Cell style overrides. */
|
|
11
|
+
nodeStyle?: NodeStyleOptions;
|
|
12
|
+
}
|
|
13
|
+
export declare class ImageLayer extends NeuralNetworkLayer {
|
|
14
|
+
private readonly _cols;
|
|
15
|
+
private readonly _cellSize;
|
|
16
|
+
private readonly _grid;
|
|
17
|
+
constructor(options?: ImageLayerOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Build the pixel grid centered on the local origin.
|
|
20
|
+
* @param rows - Number of rows.
|
|
21
|
+
* @param cols - Number of columns.
|
|
22
|
+
* @param style - Resolved cell style.
|
|
23
|
+
* @returns A VGroup of cell rectangles (empty when rows or cols is 0).
|
|
24
|
+
*/
|
|
25
|
+
private _buildGrid;
|
|
26
|
+
/** Horizontal extent of the grid, always positive for spacing. */
|
|
27
|
+
layerWidth(): number;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=ImageLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageLayer.d.ts","sourceRoot":"","sources":["../../../src/mobjects/ml/ImageLayer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAIjB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED,qBAAa,UAAW,SAAQ,kBAAkB;IAChD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;gBAEnB,OAAO,GAAE,iBAAsB;IAiB3C;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;IAwBlB,kEAAkE;IACzD,UAAU,IAAI,MAAM;CAG9B"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { VGroup } from '../../core/VGroup';
|
|
2
|
+
import { Line } from '../geometry/Line';
|
|
3
|
+
import { NeuralNetworkLayer } from './NeuralNetworkLayer';
|
|
4
|
+
import { ConnectionStyleOptions } from './mlStyles';
|
|
5
|
+
/**
|
|
6
|
+
* NeuralNetwork - a diagram of stacked layers with connection lines between
|
|
7
|
+
* adjacent layers (a manim-ml NeuralNetwork analogue).
|
|
8
|
+
*
|
|
9
|
+
* The network is a VGroup built from a list of layers. It places the layers
|
|
10
|
+
* left to right and, for every adjacent pair, draws a dense set of connection
|
|
11
|
+
* lines between their node anchors (n_i x n_{i+1} lines). Connections are added
|
|
12
|
+
* before the layers so they render behind the nodes.
|
|
13
|
+
*/
|
|
14
|
+
import * as THREE from 'three';
|
|
15
|
+
export interface NeuralNetworkOptions {
|
|
16
|
+
/** Horizontal gap between adjacent layers. Default: 1. */
|
|
17
|
+
layerSpacing?: number;
|
|
18
|
+
/** Connection line style overrides. */
|
|
19
|
+
edgeStyle?: ConnectionStyleOptions;
|
|
20
|
+
/** When false, no connection lines are drawn. Default: true. */
|
|
21
|
+
connectAdjacent?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare class NeuralNetwork extends VGroup {
|
|
24
|
+
private readonly _layers;
|
|
25
|
+
private readonly _connections;
|
|
26
|
+
/** Connection lines grouped by the gap they cross (stage i joins layer i and i+1). */
|
|
27
|
+
private readonly _stages;
|
|
28
|
+
private readonly _edgeStyle;
|
|
29
|
+
/**
|
|
30
|
+
* @param layers - The layers, drawn left to right in array order.
|
|
31
|
+
* @param options - Spacing, edge style and whether to connect layers.
|
|
32
|
+
*/
|
|
33
|
+
constructor(layers?: NeuralNetworkLayer[], options?: NeuralNetworkOptions);
|
|
34
|
+
/**
|
|
35
|
+
* A container flattens its transform into its children (layers and lines)
|
|
36
|
+
* rather than baking its own geometry, matching GenericGraph.
|
|
37
|
+
*/
|
|
38
|
+
normalizeTransform(worldMatrix?: THREE.Matrix4): this;
|
|
39
|
+
/**
|
|
40
|
+
* Place each layer so its center sits on a strictly increasing x, spaced by
|
|
41
|
+
* the layers' own widths plus `layerSpacing`. Uses shift (not moveTo) so an
|
|
42
|
+
* empty layer is positioned without measuring absent geometry.
|
|
43
|
+
* @param layerSpacing - Horizontal gap between adjacent layer edges.
|
|
44
|
+
*/
|
|
45
|
+
private _placeLayers;
|
|
46
|
+
/**
|
|
47
|
+
* Build dense connection lines between every adjacent pair of layers.
|
|
48
|
+
* A pair contributes n_i x n_{i+1} lines; a 0-node layer contributes none.
|
|
49
|
+
*/
|
|
50
|
+
private _buildConnections;
|
|
51
|
+
/** Get the layers in left-to-right order. */
|
|
52
|
+
getLayers(): NeuralNetworkLayer[];
|
|
53
|
+
/**
|
|
54
|
+
* Get a single layer by index.
|
|
55
|
+
* @param index - Zero-based layer index.
|
|
56
|
+
* @returns The layer, or undefined when the index is out of range.
|
|
57
|
+
*/
|
|
58
|
+
getLayer(index: number): NeuralNetworkLayer | undefined;
|
|
59
|
+
/** Get the number of layers. */
|
|
60
|
+
get numLayers(): number;
|
|
61
|
+
/** Get every connection line, flattened across all gaps. */
|
|
62
|
+
getConnections(): Line[];
|
|
63
|
+
/**
|
|
64
|
+
* Get the connection lines grouped by gap. Entry i holds the lines that join
|
|
65
|
+
* layer i and layer i+1.
|
|
66
|
+
*/
|
|
67
|
+
getConnectionStages(): Line[][];
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=NeuralNetwork.d.ts.map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ED,4DAA4D;IAC5D,cAAc,IAAI,IAAI,EAAE;IAIxB;;;OAGG;IACH,mBAAmB,IAAI,IAAI,EAAE,EAAE;CAGhC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { VGroup } from '../../core/VGroup';
|
|
2
|
+
import { VMobject } from '../../core/VMobject';
|
|
3
|
+
import { Vector3Tuple } from '../../core/Mobject';
|
|
4
|
+
/**
|
|
5
|
+
* NeuralNetworkLayer - abstract base for every layer in a NeuralNetwork.
|
|
6
|
+
*
|
|
7
|
+
* A layer is a VGroup of node mobjects (circles, feature-map squares, a pixel
|
|
8
|
+
* grid). The NeuralNetwork places layers left to right and draws connection
|
|
9
|
+
* lines between the anchor points of adjacent layers. Each concrete layer
|
|
10
|
+
* exposes the same small interface so the network can treat them uniformly.
|
|
11
|
+
*/
|
|
12
|
+
import * as THREE from 'three';
|
|
13
|
+
export declare abstract class NeuralNetworkLayer extends VGroup {
|
|
14
|
+
/**
|
|
15
|
+
* The node mobjects of this layer, in top-to-bottom order.
|
|
16
|
+
*
|
|
17
|
+
* A connection attaches to a node's center, so this list defines how many
|
|
18
|
+
* edges the network draws to the next layer. It may be empty (a layer with
|
|
19
|
+
* zero nodes), which the network treats as "no connections".
|
|
20
|
+
*/
|
|
21
|
+
protected _nodes: VMobject[];
|
|
22
|
+
/**
|
|
23
|
+
* A container flattens its own transform into its children instead of baking
|
|
24
|
+
* geometry, exactly like GenericGraph. This keeps node centers and the
|
|
25
|
+
* connection lines (which the network positions in world space) correct when
|
|
26
|
+
* a scene normalizes the family.
|
|
27
|
+
*/
|
|
28
|
+
normalizeTransform(worldMatrix?: THREE.Matrix4): this;
|
|
29
|
+
/**
|
|
30
|
+
* Get the node mobjects of this layer.
|
|
31
|
+
* @returns The nodes in top-to-bottom order (an empty array for a 0-node layer).
|
|
32
|
+
*/
|
|
33
|
+
getNodes(): VMobject[];
|
|
34
|
+
/**
|
|
35
|
+
* Get the number of nodes (connection anchors) in this layer.
|
|
36
|
+
*/
|
|
37
|
+
get numNodes(): number;
|
|
38
|
+
/**
|
|
39
|
+
* Get the world-space anchor point of each node, in node order.
|
|
40
|
+
*
|
|
41
|
+
* The network calls this after it has positioned the layer, so the centers
|
|
42
|
+
* already include the layer's placement offset.
|
|
43
|
+
* @returns One center per node (an empty array for a 0-node layer).
|
|
44
|
+
*/
|
|
45
|
+
nodeAnchors(): Vector3Tuple[];
|
|
46
|
+
/**
|
|
47
|
+
* Get the horizontal extent used to space this layer from its neighbours.
|
|
48
|
+
*
|
|
49
|
+
* It must return a positive number even when the layer has zero nodes, so the
|
|
50
|
+
* network can lay out an empty layer without measuring absent geometry.
|
|
51
|
+
*/
|
|
52
|
+
abstract layerWidth(): number;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=NeuralNetworkLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NeuralNetworkLayer.d.ts","sourceRoot":"","sources":["../../../src/mobjects/ml/NeuralNetworkLayer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,8BAAsB,kBAAmB,SAAQ,MAAM;IACrD;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAM;IAElC;;;;;OAKG;IACM,kBAAkB,CAAC,WAAW,GAAE,KAAK,CAAC,OAA2B,GAAG,IAAI;IAIjF;;;OAGG;IACH,QAAQ,IAAI,QAAQ,EAAE;IAItB;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;;;;OAMG;IACH,WAAW,IAAI,YAAY,EAAE;IAI7B;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,IAAI,MAAM;CAC9B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NeuralNetworkLayer } from './NeuralNetworkLayer';
|
|
2
|
+
import { NodeStyleOptions } from './mlStyles';
|
|
3
|
+
export interface PoolingLayerOptions {
|
|
4
|
+
/** Number of feature-map squares in the stack. Default: 3. Must be >= 0. */
|
|
5
|
+
numFeatureMaps?: number;
|
|
6
|
+
/** Side length of each square feature map. Default: 0.3. */
|
|
7
|
+
mapSize?: number;
|
|
8
|
+
/** Diagonal offset between adjacent squares. Default: 0.12. */
|
|
9
|
+
offset?: number;
|
|
10
|
+
/** Node style overrides for the squares. */
|
|
11
|
+
nodeStyle?: NodeStyleOptions;
|
|
12
|
+
}
|
|
13
|
+
export declare class PoolingLayer extends NeuralNetworkLayer {
|
|
14
|
+
private readonly _width;
|
|
15
|
+
constructor(options?: PoolingLayerOptions);
|
|
16
|
+
/** Horizontal extent of the feature-map stack, used for spacing. */
|
|
17
|
+
layerWidth(): number;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=PoolingLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoolingLayer.d.ts","sourceRoot":"","sources":["../../../src/mobjects/ml/PoolingLayer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EACL,gBAAgB,EAIjB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED,qBAAa,YAAa,SAAQ,kBAAkB;IAClD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,OAAO,GAAE,mBAAwB;IAgB7C,oEAAoE;IAC3D,UAAU,IAAI,MAAM;CAG9B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VMobject } from '../../core/VMobject';
|
|
2
|
+
import { ResolvedNodeStyle } from './mlStyles';
|
|
3
|
+
export interface FeatureMapStackConfig {
|
|
4
|
+
/** Number of stacked feature-map squares. Must be >= 0. */
|
|
5
|
+
numFeatureMaps: number;
|
|
6
|
+
/** Side length of each square feature map. */
|
|
7
|
+
mapSize: number;
|
|
8
|
+
/** Diagonal offset between adjacent squares in the stack. */
|
|
9
|
+
offset: number;
|
|
10
|
+
/** Resolved node style for the squares. */
|
|
11
|
+
style: ResolvedNodeStyle;
|
|
12
|
+
}
|
|
13
|
+
export interface FeatureMapStackResult {
|
|
14
|
+
/** The feature-map squares, front (first) to back (last). */
|
|
15
|
+
nodes: VMobject[];
|
|
16
|
+
/** Horizontal extent of the stack, always positive. */
|
|
17
|
+
width: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Build a diagonal stack of square feature maps centered on the local origin.
|
|
21
|
+
* @param config - Count, size, offset and style of the stack.
|
|
22
|
+
* @returns The square nodes and the stack's horizontal extent.
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildFeatureMapStack(config: FeatureMapStackConfig): FeatureMapStackResult;
|
|
25
|
+
//# sourceMappingURL=featureMapStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureMapStack.d.ts","sourceRoot":"","sources":["../../../src/mobjects/ml/featureMapStack.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,qBAAqB;IACpC,2DAA2D;IAC3D,cAAc,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,6DAA6D;IAC7D,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,qBAAqB,GAAG,qBAAqB,CAyBzF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Animation } from '../../animation/Animation';
|
|
2
|
+
import { NeuralNetwork } from './NeuralNetwork';
|
|
3
|
+
import { EdgePulseOptions } from './EdgePulse';
|
|
4
|
+
export interface ForwardPassOptions extends EdgePulseOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Overlap between consecutive gaps. 1 is strictly sequential (one gap fully
|
|
7
|
+
* lit before the next starts), 0 is all gaps at once. Default: 1.
|
|
8
|
+
*/
|
|
9
|
+
lagRatio?: number;
|
|
10
|
+
/** Duration of each gap's pulse in seconds. Default: 1. */
|
|
11
|
+
gapDuration?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Animate a forward pass: light each gap's connections from input to output.
|
|
15
|
+
* @param network - The network to animate.
|
|
16
|
+
* @param options - Pulse color/opacity, lagRatio and per-gap duration.
|
|
17
|
+
* @returns A LaggedStart over the gaps (an empty, zero-duration one for a
|
|
18
|
+
* network with fewer than two layers).
|
|
19
|
+
*/
|
|
20
|
+
export declare function forwardPass(network: NeuralNetwork, options?: ForwardPassOptions): Animation;
|
|
21
|
+
/**
|
|
22
|
+
* Animate a backward pass: light each gap's connections from output to input.
|
|
23
|
+
* @param network - The network to animate.
|
|
24
|
+
* @param options - Pulse color/opacity, lagRatio and per-gap duration.
|
|
25
|
+
* @returns A LaggedStart over the gaps in reverse order.
|
|
26
|
+
*/
|
|
27
|
+
export declare function backwardPass(network: NeuralNetwork, options?: ForwardPassOptions): Animation;
|
|
28
|
+
//# sourceMappingURL=forwardPass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forwardPass.d.ts","sourceRoot":"","sources":["../../../src/mobjects/ml/forwardPass.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAItD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA8BD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,GAAE,kBAAuB,GAAG,SAAS,CAG/F;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,GAAE,kBAAuB,GAAG,SAAS,CAGhG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Neural-network / ML diagram toolkit for manim-web.
|
|
3
|
+
*
|
|
4
|
+
* A manim-ml analogue built purely by composition: layers are VGroups of
|
|
5
|
+
* geometry, the network arranges them and draws connections, and forward /
|
|
6
|
+
* backward passes animate a signal flowing through the connections.
|
|
7
|
+
*/
|
|
8
|
+
export { type NodeStyleOptions, type ConnectionStyleOptions, type ResolvedNodeStyle, type ResolvedEdgeStyle, DEFAULT_NODE_STYLE, DEFAULT_EDGE_STYLE, DEFAULT_ACTIVATION_COLOR, resolveNodeStyle, resolveEdgeStyle, } from './mlStyles';
|
|
9
|
+
export { NeuralNetworkLayer } from './NeuralNetworkLayer';
|
|
10
|
+
export { FeedForwardLayer, type FeedForwardLayerOptions } from './FeedForwardLayer';
|
|
11
|
+
export { ConvolutionalLayer, type ConvolutionalLayerOptions } from './ConvolutionalLayer';
|
|
12
|
+
export { PoolingLayer, type PoolingLayerOptions } from './PoolingLayer';
|
|
13
|
+
export { ImageLayer, type ImageLayerOptions } from './ImageLayer';
|
|
14
|
+
export { buildFeatureMapStack, type FeatureMapStackConfig, type FeatureMapStackResult, } from './featureMapStack';
|
|
15
|
+
export { NeuralNetwork, type NeuralNetworkOptions } from './NeuralNetwork';
|
|
16
|
+
export { EdgePulse, edgePulse, type EdgePulseOptions } from './EdgePulse';
|
|
17
|
+
export { forwardPass, backwardPass, type ForwardPassOptions } from './forwardPass';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/ml/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,KAAK,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EACL,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG3E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
|