# scoreExamples and outputSingle output shape

**URL:** <https://community.konduit.ai/t/scoreexamples-and-outputsingle-output-shape/3176>\
**Category:** DL4J\
**Created:** [June 20, 2024, 6:03pm UTC](https://community.konduit.ai/t/scoreexamples-and-outputsingle-output-shape/3176 "2024-06-20T18:03:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![timmy1010697](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@timmy1010697](https://community.konduit.ai/u/timmy1010697)\
**Post date:** [June 20, 2024, 6:03pm UTC](https://community.konduit.ai/t/scoreexamples-and-outputsingle-output-shape/3176/1 "2024-06-20T18:03:21Z")

</div>

I’m working on a ComputationGraph and a MultiLayerNetwork with the need to obtain its output and the loss for each entry of the batch. The below is the configuration for my ComputationGraph and MultiLayerNetwork.

```auto
MultiLayerConfiguration conf_MLN = new NeuralNetConfiguration.Builder()
					.weightInit(WeightInit.XAVIER_UNIFORM)
					.updater(new RmsProp())
					.list()
					.layer(new DenseLayer.Builder().nIn(n_feat).nOut(1).activation(Activation.RELU).build())
					.layer(new OutputLayer.Builder(LossFunctions.LossFunction.MSE)
							.nIn(1).nOut(1).activation(Activation.IDENTITY)
							.build())
					.build();

ComputationGraphConfiguration conf_CG = new NeuralNetConfiguration.Builder()
					.weightInit(WeightInit.XAVIER_UNIFORM)
					.updater(new RmsProp())
					.graphBuilder()
					.addInputs("state", "omega")
					.addVertex("merge",new MergeVertex(),"state","omega")
					.addLayer("L1", new DenseLayer.Builder().nIn(n_feat+2).nOut(2).activation(Activation.RELU).build(),"merge")//feature length+objective weights len
					.addLayer("out",new OutputLayer.Builder(LossFunctions.LossFunction.MSE)
							.nIn(2).nOut(2).activation(Activation.IDENTITY)
							.build(),"L1")
					.setOutputs("out")
					.build();

```

I have the following question regarding the size of each method’s output:

1. I supply a (batch\_size,n\_feat) input to model\_MLN.output(), is the output shape (batch\_size,1) or (batch\_size)
2. I supply two inputs of shape (batch\_size,n\_feat) and (batch\_size,2) to model\_CG.outputSingle(), is tge output shape (batch\_size,2)?
3. When I use .score(DataSet) for MultiLayerNetwork, do I get the sum of mse for all entries or the average?
4. When I use .score(MultiDataSet) for the above ComputationGraph, how is the score calculated across the outputs.
5. I want to obtain the MSE loss for each “entry” of the batch (shape [batch\_size]), should I use scoreExamples to get it for the above ComputationGraph and MultiLayerNetwork? I ask some AI-LLM-chat models, and they said that scoreExamples calculate the loss for each output of each entry but not them together, resulting in a shape [batch\_size,2] score. I’m wondering if this is true or not, and if I were to obtain the MSE loss for each entry, which method should I use.
