Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add custom loss functions and a R/W state matrix#936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ashenmagic wants to merge32 commits intoBrainJS:master
base:master
Choose a base branch
Loading
fromashenmagic:feature/loss-function
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
32 commits
Select commitHold shift + click to select a range
ee5fc8d
Implement a loss function for GPU
ashenmagicJun 15, 2024
6baf8c6
Add partial support for loss functions
ashenmagicJun 16, 2024
eb909c9
Update loss.ts
ashenmagicJun 16, 2024
1f2c681
OMG OMG OMG!!!!!! ZOOOOOMIESSS <3333
ashenmagicJun 16, 2024
ba12f82
Fixed the bug~! <3
ashenmagicJun 16, 2024
7371a23
Generalize loss function for both CPU and GPU
ashenmagicJun 16, 2024
2a7840a
Add memory function
ashenmagicJun 16, 2024
a762a48
Backup: Another thunderstorm, power outage risk
ashenmagicJun 16, 2024
94fc99a
Revert "Backup: Another thunderstorm, power outage risk"
ashenmagicJun 16, 2024
ba03eb3
Add parameter `lossDelta`
ashenmagicJun 16, 2024
aa337f3
Rename memory to RAM
ashenmagicJun 16, 2024
c655c52
Add `updateRAM`
ashenmagicJun 17, 2024
b45d581
Fix bug that required `ramSize` to be defined
ashenmagicJun 17, 2024
b703e4a
Prune unused code
ashenmagicJun 17, 2024
fda0349
Run `updateRAM` on both CPU and GPU nets
ashenmagicJun 17, 2024
3d392f1
Design custom loss function for autoencoders
ashenmagicJun 17, 2024
ce98bf1
Fix CI task errors
ashenmagicJun 17, 2024
51b9aa9
Fix a CI task related to type coersion
ashenmagicJun 17, 2024
c5c8438
TypeScript hates me today
ashenmagicJun 17, 2024
e8384a5
Fix all lint errors
ashenmagicJun 17, 2024
a21c387
Remove unused `@ts-expect-error` directive
ashenmagicJun 17, 2024
83574f6
Please, linter gods, pleaaaase stop hating me
ashenmagicJun 17, 2024
52edc88
Properly initialize `NeuralNetwork.ram`
ashenmagicJun 18, 2024
8f8f455
Finish updating autoencoder to use loss function
ashenmagicJun 18, 2024
00b8515
Add a CPU variant of autoencoder
ashenmagicJun 18, 2024
e4e6906
Polish autoencoders and remove debug code
ashenmagicJun 18, 2024
4d7b5ef
Remove debug code
ashenmagicJun 18, 2024
cd0ad75
Export the CPU autoencoder implementation
ashenmagicJun 18, 2024
693bd0b
Update tests and documentation
ashenmagicJun 19, 2024
a03161f
Merge branch 'main' into feature/loss-function
ashenmagicNov 6, 2024
561dda3
Remove duplicate lines added during merge
ashenmagicDec 29, 2024
42aece2
Resolve nested tests
ashenmagicJan 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Please, linter gods, pleaaaase stop hating me
  • Loading branch information
@ashenmagic
ashenmagic committedJun 17, 2024
commit83574f627586909b19bd96f9e69e3c9b1b0887bf
7 changes: 6 additions & 1 deletionsrc/neural-network.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -323,7 +323,12 @@ export class NeuralNetwork<
constructor(
options: Partial<INeuralNetworkOptions & INeuralNetworkTrainOptions> = {}
) {
this.options = { ...this.options, ...options };
this.options.binaryThresh = options.binaryThresh ?? 0.5;
this.options.hiddenLayers = options.hiddenLayers ?? [];
this.options.inputSize = options.inputSize ?? 1;
this.options.loss = options.loss ?? loss;
this.options.outputSize = options.outputSize ?? options.inputSize ?? 1;
this.options.ramSize = options.ramSize ?? 1;
this.updateTrainingOptions(options);

const { inputSize, hiddenLayers, outputSize } = this.options;
Expand Down
4 changes: 3 additions & 1 deletionsrc/utilities/to-svg.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -467,7 +467,9 @@ export function toSVG<
// Get network size array for NeuralNetwork or NeuralNetworkGPU
let sizes: number[] = [];
if (net instanceof NeuralNetwork || net instanceof NeuralNetworkGPU) {
sizes = getNeuralNetworkSizes(net);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
sizes = getNeuralNetworkSizes((net as unknown) as NeuralNetwork);
}
// get network size for Recurrent
else if (net instanceof Recurrent) {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp