How to create a fully connected(matrix) layer with vector input I am trying to replace last fully connected layer of size 4096/2048 with a matrix of size 100x300 with previous fc layer output of 2048.



I've tried 


2D convolution - to map from 2048 --> 100x300 (Which is not realizable)
Intermediate projections :
    2048 --> 100
    [100x1] X [1x300] --> [100x300] (possible but complicated)


I am looking for a simple and effective solution with least linear transformations.
You can use tf.reshape() method (tensorflow doc) to reshape (2048) dimensional tensor to (100,300). Here's one way to do this: 

input1 = tf.reshape(input1, [100,300], name="reshaped_tensor")


If you're not using TensorFlow but using Numpy, here's an implementation:

input1 = np.array(input1)
input1 = np.reshape(input1, (100,300))


Note: You might want to follow up this layer with tf.nn.conv2d layers to "densify" the sparse matrix/values obtained from the above step.