Skip to content

Switch LayerType to string for extensibility #1685

@shelhamer

Description

@shelhamer

Originally proposed by @jeffdonahue

The bookkeeping for the LayerType enum in caffe.proto is a hassle. Having a coordination-free method to add layers would make life easier and open up Caffe for extension in forks or a potential "sandbox" section of the project.

The layer type could just be the C++ class name of the layer, minus the "Layer" at the end. So, it would look like:

layers {
  name: "accuracy"
  class: "Accuracy"  # for class AccuracyLayer
  ...
}

Introducing the class field instead of type gives a signature for automatically upgrading net definitions like we've done in the past.

LayerParameter is another obstacle. Since these are actual fields they still require unique IDs. Any thoughts on a workaround?

@jeffdonahue @Yangqing @longjon

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions