123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #pragma once
- #include <QObject>
- #include <QGenericMatrix>
- #include "remotecontrol.qpb.h"
- #include "remotecontrol_grpc.qpb.h"
- #include "visualization_grpc.qpb.h"
- #include "valueindicator.h"
- #include "abstractdense.h"
- #include "layertrigger.h"
- class ValueIndicator;
- class LayerTrigger;
- struct NetworkLayerState {
- ValueIndicatorDense m_activations;
- ValueIndicatorDense m_biases;
- ValueIndicatorDense m_weights;
- LayerTrigger m_actiovationTrigger;
- LayerTrigger m_weightTrigger;
- };
- class VisualizerModel : public QObject
- {
- Q_OBJECT
- Q_PROPERTY(QList<int> sizes READ sizes NOTIFY sizesChanged)
- Q_PROPERTY(remotecontrol::NetworkState* networkState READ networkState CONSTANT)
- public:
- explicit VisualizerModel(std::shared_ptr<remotecontrol::RemoteControlClient> &client,
- std::shared_ptr<visualization::VisualizationClient> &visualizationClient,
- QObject *parent = nullptr);
- QList<int> sizes() {
- return m_networkConfig.sizes();
- }
- Q_INVOKABLE ValueIndicator *activation(int layer, int row);
- Q_INVOKABLE ValueIndicator *weight(int layer, int row, int column);
- Q_INVOKABLE LayerTrigger *activationTrigger(int layer);
- Q_INVOKABLE LayerTrigger *weightTrigger(int layer);
- Q_INVOKABLE void start();
- remotecontrol::NetworkState *networkState() const
- {
- return m_networkState.data();
- }
- signals:
- void sizesChanged();
- private:
- std::shared_ptr<remotecontrol::RemoteControlClient> &m_client;
- std::shared_ptr<visualization::VisualizationClient> &m_visualizationClient;
- remotecontrol::Configuration m_networkConfig;
- QList<NetworkLayerState*> m_layers;
- QPointer<remotecontrol::NetworkState> m_networkState;
- };
|