Skip to content

Commit

Permalink
Merge pull request #43 from cvjena/releasing_v2.0.1
Browse files Browse the repository at this point in the history
Pull Changes for v2.0.1
  • Loading branch information
Clemens-Alexander Brust committed Dec 22, 2015
2 parents 88821b2 + 4e535b3 commit cd25956
Show file tree
Hide file tree
Showing 32 changed files with 62 additions and 1,066 deletions.
2 changes: 0 additions & 2 deletions include/cn24.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@
#include "cn24/net/ConcatenationLayer.h"
#include "cn24/net/GradientAccumulationLayer.h"
#include "cn24/net/SumLayer.h"
#include "cn24/net/Net.h"
#include "cn24/net/Trainer.h"
#include "cn24/net/NetGraph.h"
#include "cn24/net/NetStatus.h"

#include "cn24/factory/ConfigurableFactory.h"
#include "cn24/factory/SkipLayerNetworkFactory.h"

#endif
9 changes: 2 additions & 7 deletions include/cn24/factory/ConfigurableFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include <iostream>

#include "../net/Net.h"
#include "../net/NetGraph.h"
#include "../net/Trainer.h"
#include "../util/Dataset.h"
Expand All @@ -27,7 +26,6 @@ namespace Conv {

class Factory {
public:
virtual int AddLayers(Net& net, Connection data_layer_connection, const unsigned int output_classes, bool add_loss_layer = false, std::ostream& graph_output = std::cout) = 0;
virtual bool AddLayers(NetGraph& graph, NetGraphConnection data_layer_connection, const unsigned int output_classes, bool add_loss_layer = false) = 0;
virtual int patchsizex() = 0;
virtual int patchsizey() = 0;
Expand All @@ -52,17 +50,14 @@ class ConfigurableFactory : public Factory {
/**
* @brief Adds the configured layers to a network using the specified input layer
*
* @param net The net to add the layers to
* @param graph The NetGraph to add the layers to
* @param data_layer_connection Input to the first layer of this configuration
* @param output_classes The number of output neurons. This also affects the activation function of
* the last layer: for output_classes=1, tanh is used. Otherwise, sigm is used.
* @param add_loss_layer If set to true, the factory also adds a matching loss layer
* @param graph_output An output stream. The factory will write the layout in graphviz format into this string.
*
* @returns The layer id of the output layer
* @returns Whether the net is complete
*/
virtual int AddLayers(Net& net, Connection data_layer_connection, const unsigned int output_classes, bool add_loss_layer = false, std::ostream& graph_output = std::cout);

virtual bool AddLayers(NetGraph& graph, NetGraphConnection data_layer_connection, const unsigned int output_classes, bool add_loss_layer = false);

/**
Expand Down
28 changes: 0 additions & 28 deletions include/cn24/factory/SkipLayerNetworkFactory.h

This file was deleted.

2 changes: 1 addition & 1 deletion include/cn24/net/Layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Layer {
virtual bool IsOpenCLAware() { return false; }

virtual std::string GetLayerDescription() { return "Layer"; }
virtual void CreateBufferDescriptors(std::vector<NetGraphBuffer>& buffers) {}
virtual void CreateBufferDescriptors(std::vector<NetGraphBuffer>& buffers) {UNREFERENCED_PARAMETER(buffers);}
protected:
/**
* @brief These CombinedTensors contain the weights and biases.
Expand Down
210 changes: 0 additions & 210 deletions include/cn24/net/Net.h

This file was deleted.

3 changes: 3 additions & 0 deletions include/cn24/util/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ typedef u_int32_t duint;
#define UCHAR_FROM_DATUM(x) ((unsigned char) (255.0f * ((Conv::datum)x) ) )
#define MCHAR_FROM_DATUM(x) ((unsigned char) (127.0f + 127.0f * ((Conv::datum)x) ) )

// use this macro to suppress compiler warnings for unused variables
#define UNREFERENCED_PARAMETER(x) (void)x

}


Expand Down
3 changes: 1 addition & 2 deletions include/cn24/util/Dataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,7 @@ class TensorStreamDataset : public Dataset {
std::vector<std::string> class_names,
std::vector<unsigned int> class_colors,
std::vector<datum> class_weights,
dataset_localized_error_function error_function = DefaultLocalizedErrorFunction,
int training_fd = 0, int testing_fd = 0);
dataset_localized_error_function error_function = DefaultLocalizedErrorFunction);

// Dataset implementations
virtual Task GetTask() const;
Expand Down
8 changes: 4 additions & 4 deletions include/cn24/util/StatAggregator.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ struct StatDescriptor {
std::string unit = "";

// Lambdas for processing
std::function<void(Stat&)> init_function = [] (Stat& stat) {};
std::function<void(Stat&,double)> update_function = [] (Stat& stat, double user_value) {};
std::function<void(Stat&)> init_function = [] (Stat& stat) {UNREFERENCED_PARAMETER(stat);};
std::function<void(Stat&,double)> update_function = [] (Stat& stat, double user_value) {UNREFERENCED_PARAMETER(stat); UNREFERENCED_PARAMETER(user_value);};
std::function<Stat(HardcodedStats&, Stat&)> output_function =
[] (HardcodedStats& hc_stats, Stat& stat) -> Stat {return stat;};
[] (HardcodedStats& hc_stats, Stat& stat) -> Stat {UNREFERENCED_PARAMETER(hc_stats); return stat;};

// For easy access
unsigned int stat_id = UINT_MAX;
Expand Down Expand Up @@ -104,4 +104,4 @@ class StatAggregator {

}

#endif
#endif
Loading

0 comments on commit cd25956

Please sign in to comment.