Skip to content

Graph with layer #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open

Conversation

Lepsps
Copy link
Collaborator

@Lepsps Lepsps commented Mar 31, 2025

No description provided.

@Lepsps Lepsps requested a review from aobolensk as a code owner March 31, 2025 21:29
@Lepsps Lepsps requested a review from allnes as a code owner March 31, 2025 21:29
void removeLayer(Layer& lay);
int getLayers() const;
int getEdges() const;
bool empty() const;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool empty() const;
bool isEmpty() const;

std::vector<int> BFS(int start);
void setInput(Layer& lay, Tensor<double>& vec);
void setOutput(Layer& lay, Tensor<double>& vec);
void inference();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void inference();
void run();

int getEdges() const;
bool empty() const;
bool hasPath(Layer& layPrev, Layer& layNext) const;
std::vector<int> BFS(int start);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::vector<int> BFS(int start);
std::vector<int> inference(int start);

public:
Layer() = default;
virtual ~Layer() = default;
void setID(int id) { id_ = id; }
Copy link
Member

@allnes allnes Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it would be string form with integer ID

virtual ~Layer() = default;
void setID(int id) { id_ = id; }
int getID() const { return id_; }
virtual void run(const Tensor<double>& input, Tensor<double>& output) = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
virtual void run(const Tensor<double>& input, Tensor<double>& output) = 0;
virtual void exec(const Tensor<double>& input, Tensor<double>& output) = 0;

Comment on lines +20 to +21
void addNeighbor(Layer* neighbor);
void removeNeighbor(Layer* neighbor);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it important? I think its part of graph

#include "./layer/layer.h"
#include "./tensor/tensor.h"

class Graph {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class Graph {
class Network {

or Model

int id_;

public:
Layer() = default;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please create constructor with abstract class of attributes, @aobolensk what do you think?

Comment on lines +23 to +24
void addLayer(Layer& lay);
void addEdge(Layer& layPrev, Layer& layNext);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void addLayer(Layer& lay);
void addEdge(Layer& layPrev, Layer& layNext);
bool addLayer(Layer& lay, std::vector<LayerID>& InputsLayers, std::vector<LayerID>& OutputLayers);

bool for check - Layer is added or not
addEdge is redudant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants