Type of Conditions handled by Condition Interface #473
Replies: 3 comments 3 replies
-
I didn't understand the final goal of the discussion: do you want to discuss the Condition interface or which type of condition should be available? |
Beta Was this translation helpful? Give feedback.
-
Ok nice, we need that! The proposed ones are fine, but I have some doubts with:
Why should the target be a Tensor here? Isn't that a simple equation?
As before
Very important: I would create intermediate interfaces like |
Beta Was this translation helpful? Give feedback.
-
I edited the initial message adding two tables to list the needed and dreamed conditions. Please populate it! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Interfaces
InputTargetCondition
InputEquationCondition
Must Have
TensorInputTensorTargetCondition
y - model(X)
GraphInputGraphTargetCondition
graph.y - model(graph.X, ...)
GraphInputTensorTargetCondition
y - model(graph.X, ...)
TensorEquationCondition
residual(model(x), equation)
GraphEquationCondition
residual(model(graph.x), equation)
Optional desiderata
model(X1) - model(X2)
, where X1 and X2 are the samples of the two domainSomehow related to #302. In the 0.2 version, the
Condition
class is viewing a huge refactoring to be more versatile and customizable by the user. However, before adding new conditions, I would like to suggest a standard interface for the majority of the problems in DL (of course there is always the possibility to add multiple conditions). Below, I summarize the API:** Supervised Problems **
In supervised problems, we always have an
input
and atarget
thus, the condition must reflect this, so I propose something asCondition(input=..., target=...)
, where the following combinations are available:instance(input) == Graph/iter[Graph], instance(output) == Graph/iter[Graph]
, if iterable samelen
instance(input) == Tensor/LabelTensor, instance(output) == Tensor/LabelTensor
instance(input) == Graph/iter[Graph], instance(output) == Tensor/LabelTensor
, if iterable theoutput.shape[0] == graph len
These three scenarios should cover the majority of Supervised Learning strategies. To construct the three, we use:
GraphInputOutputCondition
=> maybe renamingGraphInputGraphTargetCondition
InputOutputCondition
=> maybe renamingTensorInputTensorTargetCondition
GraphInputTensorOutputCondition
=> maybe renamingGraphInputTensorTargetCondition
I suggest to factor everything into an
InputTargetCondition
, so that it will be useful for user to define a new solver i/o without needing to import all the conditions.** Physics Informed Problems**
In physics-informed problems, we always have an
input
and anequation
; where the equation computes specific differential operations on the processedinput
, thus I proposeCondition(input=..., equation=...)
, where the following combinations are available:instance(input) == LabelTensor, instance(output) == LabelTensor
instance(input) == LabelGraph, instance(output) == LabelTensor
where
LabelGraph
is simply a graph object with at least one attribute labetensor. To construct the two, we use:InputEquationCondition
=> renamingTensorEquationCondition
GraphtEquationCondition
=> renamingGraphEquationCondition
I suggest to factor everything into an
InputEquationCondition
, so that it will be useful for the user to define a new solver i/eq without needing to import all the conditions.** Unsupervised Problems**
In unsupervised problems, we always have a
data
and (possibly) aconditional_variable
, thus I proposeCondition(data=..., conditional_variable=None)
, where the following combinations are available:instance(data) == LabelTensor/Graph/iter[Graph]
instance(conditional_variable) == Tensor/LabelTensor
(conditioning on graph is also possible but I would avoid at the moment).To construct the two, we use:
DataCondition
which depending on the input returns one of the already built in above with the modified__slots__
. For exampleDataCondition(Tensor, Tensor)
would useTensorInputTensorTargetCondition
.Beta Was this translation helpful? Give feedback.
All reactions