This repository has been archived on 2019-09-17. You can view files and clone it, but cannot push or open issues or pull requests.
Files
research-project/src/LayerData.hpp
Bert Peters 19390f8d4f Create an intermediate representation.
This way the visualiser does not need to know all about caffe, and can
just work on the intermediate representation which is a lot easier on
the compiler.
2017-10-12 14:21:53 +02:00

51 lines
929 B
C++

#pragma once
#include <memory>
#include <string>
#include <string_view>
#include <vector>
#include "utils.hpp"
namespace fmri {
using std::string;
using std::string_view;
using std::unique_ptr;
using std::vector;
class LayerData
{
public:
enum class Type {
Input,
Convolutional,
ReLU,
Pooling,
Output,
Other
};
LayerData(const string& name, const vector<int>& shape, const DType* data, Type type);
LayerData(const LayerData&) = delete;
LayerData(LayerData&&) = default;
LayerData& operator=(const LayerData&) = delete;
LayerData& operator=(LayerData&&) = default;
const string& name() const;
Type type() const;
const vector<int>& shape() const;
DType const * data() const;
size_t numEntries() const;
static Type typeFromString(string_view name);
private:
string name_;
vector<int> shape_;
unique_ptr<DType[]> data_;
Type type_;
};
}