<p>Counting the number of objects in the scene can be done using normal neural networks using a sliding window approach: <a href="https://arxiv.org/pdf/1312.6229.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1312.6229.pdf</a>. </p>

<p>Here a regressor and a classification network is used. The classification network is trained with one-hot encoding as you did. The regressor is used to find object boundaries. In the paper this is done by penalizing the regressor network by the output of the classification network. Then the object boundaries produced by the regressor network are used to predict objects in the scene.</p>

<p>Edit: The response above solves a different problem.</p>

<p>What I would do is an approach based on Generative Adversarial Networks (<a href="http://papers.nips.cc/paper/5423-generative-adversarial-nets.pdf" rel="nofollow noreferrer">http://papers.nips.cc/paper/5423-generative-adversarial-nets.pdf</a>). I would add vector of random variables to the input to introduce stochastic elements into the network. The generator generates a new room assessment based on the input vector and the stochastic input, while the discriminator discriminates between good assignments and bad assignments based on the output and the input without the stochastic component. This should converge to a generator for your one-hot encoding where you can control the output using a random variable.  </p>
How to use neural networks to decide what kind of and how many furniture to appear in a room?
<p>I am working on some problems on room design. I got a lot of room design samples and would like to produce new designs by studying these samples. The very first problem is to decide what kind of and how many furniture to appear in a room.</p>

<p>For a specific design sample, I know its room function, e.g. bedroom or living room. I can also count the number of furniture of different categories in this room, say one sofa, one tea table and two chairs.</p>

<p>I built a neural network whose input is the one-hot encoding of room's function and whose output is a vector representing the number of furniture in different categories in that room. Therefore, this network can be trained with supervised learning. However, the problem with neural networks is that for a fixed input it can give only a fixed output, that is, for the rooms of identical function, it will always give the same set of furniture number. Is there any way to introduce stochastic into a neural network?</p>

<p>I have ever come across the following question <a href="https://www.quora.com/What-is-a-stochastic-neural-network-and-how-does-it-differ-from-a-deterministic-one" rel="nofollow noreferrer">https://www.quora.com/What-is-a-stochastic-neural-network-and-how-does-it-differ-from-a-deterministic-one</a> and the paper <a href="http://www.cs.toronto.edu/~tang/papers/sfnn.pdf" rel="nofollow noreferrer">http://www.cs.toronto.edu/~tang/papers/sfnn.pdf</a> suggested by an answer, but the stochastic neural network mentioned in that paper looks like probabilistic graphical models to me, unlike most neural networks that can be easily implemented by deep learning libraries like Torch or Tensorflow. </p>