Search in sources :

Example 1 with IntArrayIntIndexAdpater

use of org.nd4j.imports.descriptors.properties.adapters.IntArrayIntIndexAdpater in project nd4j by deeplearning4j.

the class Conv3D method attributeAdaptersForFunction.

@Override
public Map<String, Map<String, AttributeAdapter>> attributeAdaptersForFunction() {
    Map<String, Map<String, AttributeAdapter>> ret = new LinkedHashMap<>();
    Map<String, AttributeAdapter> tfAdapters = new LinkedHashMap<>();
    val fields = DifferentialFunctionClassHolder.getInstance().getFieldsForFunction(this);
    tfAdapters.put("kT", new ConditionalFieldValueNDArrayShapeAdapter("NDHWC", 0, 2, fields.get("dataFormat")));
    tfAdapters.put("kH", new ConditionalFieldValueNDArrayShapeAdapter("NDHWC", 1, 3, fields.get("dataFormat")));
    tfAdapters.put("kW", new ConditionalFieldValueNDArrayShapeAdapter("NDHWC", 2, 4, fields.get("dataFormat")));
    tfAdapters.put("dT", new IntArrayIntIndexAdpater(1));
    tfAdapters.put("dH", new IntArrayIntIndexAdpater(2));
    tfAdapters.put("dW", new IntArrayIntIndexAdpater(3));
    tfAdapters.put("pT", new IntArrayIntIndexAdpater(1));
    tfAdapters.put("pH", new IntArrayIntIndexAdpater(2));
    tfAdapters.put("pW", new IntArrayIntIndexAdpater(3));
    tfAdapters.put("isValidMode", new StringEqualsAdapter("VALID"));
    tfAdapters.put("isNCDHW", new StringEqualsAdapter("NCDHW"));
    ret.put(tensorflowName(), tfAdapters);
    return ret;
}
Also used : lombok.val(lombok.val) ConditionalFieldValueNDArrayShapeAdapter(org.nd4j.imports.descriptors.properties.adapters.ConditionalFieldValueNDArrayShapeAdapter) AttributeAdapter(org.nd4j.imports.descriptors.properties.AttributeAdapter) StringEqualsAdapter(org.nd4j.imports.descriptors.properties.adapters.StringEqualsAdapter) IntArrayIntIndexAdpater(org.nd4j.imports.descriptors.properties.adapters.IntArrayIntIndexAdpater)

Example 2 with IntArrayIntIndexAdpater

use of org.nd4j.imports.descriptors.properties.adapters.IntArrayIntIndexAdpater in project nd4j by deeplearning4j.

the class FullConv3D method attributeAdaptersForFunction.

@Override
public Map<String, Map<String, AttributeAdapter>> attributeAdaptersForFunction() {
    Map<String, Map<String, AttributeAdapter>> ret = new LinkedHashMap<>();
    Map<String, AttributeAdapter> tfAdapters = new LinkedHashMap<>();
    tfAdapters.put("dT", new IntArrayIntIndexAdpater(1));
    tfAdapters.put("dW", new IntArrayIntIndexAdpater(2));
    tfAdapters.put("dH", new IntArrayIntIndexAdpater(3));
    tfAdapters.put("pT", new IntArrayIntIndexAdpater(1));
    tfAdapters.put("pW", new IntArrayIntIndexAdpater(2));
    tfAdapters.put("pH", new IntArrayIntIndexAdpater(3));
    ret.put(tensorflowName(), tfAdapters);
    return ret;
}
Also used : AttributeAdapter(org.nd4j.imports.descriptors.properties.AttributeAdapter) IntArrayIntIndexAdpater(org.nd4j.imports.descriptors.properties.adapters.IntArrayIntIndexAdpater)

Aggregations

AttributeAdapter (org.nd4j.imports.descriptors.properties.AttributeAdapter)2 IntArrayIntIndexAdpater (org.nd4j.imports.descriptors.properties.adapters.IntArrayIntIndexAdpater)2 lombok.val (lombok.val)1 ConditionalFieldValueNDArrayShapeAdapter (org.nd4j.imports.descriptors.properties.adapters.ConditionalFieldValueNDArrayShapeAdapter)1 StringEqualsAdapter (org.nd4j.imports.descriptors.properties.adapters.StringEqualsAdapter)1