-
-
Notifications
You must be signed in to change notification settings - Fork 7
Fix Issue 401 Error #448
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix Issue 401 Error #448
Changes from 10 commits
705c5d6
18de217
e405284
23e7580
541725b
1f3bbd6
4829b48
b9f9fdd
ded3d8f
ff2bf25
93b15fa
29b8ca2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| using AiDotNet.NeuralNetworks.Layers.Graph; | ||
|
|
||
| namespace AiDotNet.Helpers; | ||
|
|
||
| /// <summary> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| using AiDotNet.NeuralNetworks.Layers.Graph; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update GraphNeuralNetwork to use This file still hard-codes Concrete issues:
I recommend centralizing on - foreach (var layer in Layers)
- {
- if (layer is GraphConvolutionalLayer<T> graphLayer)
- {
- current = graphLayer.Forward(current, adjacencyMatrix);
- }
- else if (layer is ILayer<T> standardLayer)
- {
- // Handle non-graph layers (e.g., Dense, Activation)
- current = standardLayer.Forward(current);
- }
- else
- {
- throw new InvalidOperationException($"Unsupported layer type: {layer.GetType().Name}");
- }
- ...
- }
+ foreach (var layer in Layers)
+ {
+ if (layer is IGraphConvolutionLayer<T> graphLayer)
+ {
+ graphLayer.SetAdjacencyMatrix(adjacencyMatrix);
+ current = layer.Forward(current);
+ }
+ else
+ {
+ current = layer.Forward(current);
+ }
+
+ if (current.Rank < 2)
+ throw new InvalidOperationException($"Layer {layer.GetType().Name} produced an invalid output shape.");
+ }And similarly for - if (Layers[i] is GraphConvolutionalLayer<T>)
+ if (Layers[i] is IGraphConvolutionLayer<T>)
{
// For graph layers, we need adjacency information which is not available
// Just pass through without modification for standard prediction
continue;
}- { "GraphLayerCount", Layers.Count(l => l is GraphConvolutionalLayer<T>) },
- { "StandardLayerCount", Layers.Count(l => !(l is GraphConvolutionalLayer<T>)) },
+ { "GraphLayerCount", Layers.Count(l => l is IGraphConvolutionLayer<T>) },
+ { "StandardLayerCount", Layers.Count(l => l is not IGraphConvolutionLayer<T>) },This will (1) fix the compile-time break with Also applies to: 529-559, 685-701, 887-893 🤖 Prompt for AI Agents |
||
|
|
||
| namespace AiDotNet.NeuralNetworks; | ||
|
|
||
| /// <summary> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.