1

I have a Convolution layer in my R code, created as:
conv1 <- mx.symbol.Convolution(data=data, kernel=c(10,1), num_filter=10)

Once the net is fully trained, how can I extract the 10 filters?

CinCout
  • 9,486
  • 12
  • 49
  • 67
Dan
  • 11
  • 3

1 Answers1

2

The filter weights are in the weight parameter of the Convolution. Assuming you have used the standard layout, as in your example, the weights will have shape (num_filter, channels, kernel[0], kernel[1]).

For example

conv1.weight.data()[0]

accesses the weight tensor of the first filter from the current context.

Christopher Barber
  • 2,548
  • 1
  • 22
  • 23