Group Abstract Group Abstract

Message Boards Message Boards

0
|
1K Views
|
7 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Nonlinearity in inputs without activation function layers?

Posted 21 days ago

I would like to set up a network for which the output has both linear and quadratic terms in the input nodes, but nothing of higher order. So for example Out1=a11 In1+a12 In2+b12 In1 In2. Is this possible with the current infrastructure?

POSTED BY: Iuval Clejan
7 Replies
Posted 15 days ago

I think I have it. But I have another question. I figured out how to initialize the weights for my quadratic net in the way that I want, but I may need to constrain which ones are learnable and which are constant, and I don't know how to do that.

POSTED BY: Updating Name

You can use the LearningRateMultipliers to freeze layers during training. Also, can you edit your post with the current solution? It will be useful for future people ending up here. Thanks!

Posted 15 days ago

Here is an example of what works. There is some book keeping up front to define the sparse initialization array which might distract from the main point, but I don't have time right now to make a nicer example. I don't need to freeze a whole layer, just part of it. What I need is actually a non-linear convolution, so only certain parameters need to be frozen in the convolution kernel. Also, is NetArray the only way to add user-specified learnable parameters?

POSTED BY: Iuval Clejan
Posted 14 days ago

How do I extract the parameters after training so I can see what is going wrong? The quadratic function in the inputs seems to work, despite my previous post (deleted).

POSTED BY: Iuval Clejan
Posted 19 days ago

Thanks, Giulio.

I am having trouble with the syntax. How can I generalize the previous so that given an input vector x of size n, I get an output vector y of size m, where yk=Sum{i,j}[ A{kij}xi xj ]+Sumj [ B{kj} xj ]? And then the a{kij} and B{kj} are learnable parameters and can be initialized in specific ways (for example the a tensor will be sparse, with nonzero entries only for i,j close to k)?

POSTED BY: Iuval Clejan

A graph like this should do what you want

NetGraph[
 {
  AggregationLayer[Times, 1],
  AppendLayer[],
  LinearLayer[{}]
  },
 {{NetPort["Input"], 1} -> 2 -> 3},
 "Input" -> 2
 ]
  • AggregationLayer is combining the two values using Times
  • AppendLayer is appending the product the the input
  • LinearLayer is learning the linear transformation
Posted 16 days ago

I realize I need something with FunctionLayer and NetArray, but I am not sure of the syntax after reading the documentation. Help, please...

POSTED BY: Iuval Clejan
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard