Skip to content

Commit e964c07

Browse files
committed
Added new NodeBuilder + operator
1 parent b6a3d2a commit e964c07

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

NeuralNetwork.NET/Networks/Graph/NodeBuilder.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ internal T GetParameter<T>() => Parameter != null && Parameter.GetType() == type
8484

8585
#region APIs
8686

87+
/// <summary>
88+
/// Creates a new linear sum node that merges two input nodes
89+
/// </summary>
90+
/// <param name="first">The first node to sum</param>
91+
/// <param name="second">The second node to sum</param>
92+
[PublicAPI]
93+
[MustUseReturnValue, NotNull]
94+
public static NodeBuilder operator +([NotNull] NodeBuilder first, [NotNull] NodeBuilder second) => first.Sum(second);
95+
8796
/// <summary>
8897
/// Creates a new linear sum node that merges multiple input nodes
8998
/// </summary>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ INeuralNetwork network = NetworkManager.NewGraph(TensorInfo.Image<Rgb24>(32,32),
122122
CuDnnNetworkLayers.Convolutional((1, 1), 20, ActivationType.ReLU),
123123
CuDnnNetworkLayers.Convolutional(ConvolutionInfo.Same(), (5, 5), 40, ActivationType.ReLU),
124124
CuDnnNetworkLayers.Convolutional((1, 1), 20, ActivationType.ReLU));
125-
var sum = conv2.Sum(pool1);
125+
var sum = conv2 + pool1;
126126

127127
var fc1 = sum.Layer(CuDnnNetworkLayers.FullyConnected(250, ActivationType.LeCunTanh));
128128
var fc2 = fc1.Layer(CuDnnNetworkLayers.FullyConnected(125, ActivationType.LeCunTanh));

0 commit comments

Comments
 (0)