Is there any DCC algorithm implemented in Veins? - veins

I learned from the Veins website that Veins relies on IEEE 802.11p and 1609.4 which does not mandate a DCC mechanism. I am wondering if any DCC algorithm is still implemented in Veins except using 3rd party models?

As of Veins 5.0, no "standard" ETSI Decentralized Congestion Control (DCC) model is included with Veins. If you are looking for a set of models that focuses on the ETSI stack, you might find the https://github.com/riebl/artery project interesting.

Related

Convert Keras model to C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am using Keras (with Theano) to train my CNN model. Does anyone has idea how can I use it in my C++ application? Does anyone tried something similar? I have idea to write some python code that will generate a c++ code with network functions - any suggestion on it?
I found a similar question here how to use Tensorflow Keras model in C++ but without answer.
To answer my own question and have a solution - I wrote a plain c++ solution called keras2cpp (its code available on github).
In this solution you store network architecture (in json) and weights (in hdf5). Then you can dump a network to a plain text file with provided script. You can use obtained text file with network in pure c++ code. There are no dependencies on python libraries or hdf5. It should work for theano and tensorflow backend.
I found myself in a similar situation but needed to not only support forward passes of sequential Keras models in C++ but also of more complex models build with the functional API.
So I wrote a new library called frugally-deep. You can find it on GitHub and it is published under the MIT License: https://github.com/Dobiasd/frugally-deep
Additionally to supporting many common layer types it can keep up with (and sometimes even beat) the performance of TensorFlow on a single CPU. You can find up-to-date benchmark results for some common model in the repo.
By automatic testing frugally-deep guarantees that the output of a model used with it in C++ is exactly the same as if run with Keras in Python.
If your keras model is trained using tensorflow backend, you can save the keras model as a tensorflow model following this code:
https://github.com/amir-abdi/keras_to_tensorflow
Here is a shorter version of the code:
from keras import backend as K
from tensorflow.python.framework import graph_util
from tensorflow.python.framework import graph_io
weight_file_path = 'path to your keras model'
net_model = load_model(weight_file_path)
sess = K.get_session()
constant_graph = graph_util.convert_variables_to_constants(sess, sess.graph.as_graph_def(), 'name of the output tensor')
graph_io.write_graph(constant_graph, 'output_folder_path', 'output.pb', as_text=False)
print('saved the constant graph (ready for inference) at: ', osp.join('output_folder_path', 'output.pb'))
You Can try this one
https://github.com/gosha20777/keras2cpp
Keras2cpp is a small library for running trained Keras models from a C++ application without any dependencies.
Supported Keras layers:
- Dense
- Convolution1D
- Convolution2D
- Convolution3D
- Flatten
- ELU
- Activation
- MaxPooling2D
- Embedding
- LocallyConnected1D
- LocallyConnected2D
- LSTM
- GRU
- CNN
- BatchNormalization
Supported activation:
- linear
- relu
- softplus
- tanh
- sigmoid
- hard_sigmoid
- elu
- softsign
- softmax
Design goals:
Compatibility with networks generated by Keras using TensorFlow backend.
CPU only.
No external dependencies, standard library, C++17.
Model stored in memory.
The solutions found here are quite good, but if your model has some different types of layers not supported by these libraries, I would recommend doing the following:
Converting the Keras model to a tensorflow model.
Freeze the model and use Tranform graph tool provided by tensorflow (you'll have to build it from source with bazel)
Compile the C++ API tensorflow library to use it in your project.
Use the C++ API tensorflow library and link the libraries to your project.
If you want to use a something differentcompiler than bazel (like g++ for example) you can follow this great tuturial:
http://tuatini.me/building-tensorflow-as-a-standalone-project/
The easiest way is probably to make a system call to a Python script that writes the predictions to a binary or HDF5 file, which can be read in from C++. You can also directly integrate Python into C++.
If you need to deploy and distribute this easily, you can look into self-contained Python installations like Anaconda, but your best bet may be to avoid Keras and use the C++ interface to Caffe or Tensorflow. I wouldn't recommend Tensorflow since using it from C++ isn't standard; see this discussion. Caffe is arguably the second most-popular deep learning library so you can't really go wrong.
I had a similar need--I wanted to embed Keras models in a C++ application--and decided to write my own library: Kerasify
Design goals of Kerasify:
Compatibility with image processing Sequential networks generated by Keras using Theano backend. (Could work with Tensorflow if you switch around matrix col/row ordering).
No external dependencies, standard library, C++11 features OK.
Model stored on disk in binary format that can be quickly read.
Model stored in memory in contiguous block for better cache performance.
Doesn't throw exceptions, returns only bool on error.
CPU only, no GPU
Example code, unit tests, etc. at the github link. It's not fully complete, it only supports the narrow subset of Keras functions I'm using, but it should be extensible with a little effort.

DSRC Implementation in Veins

I was wondering how Veins framework has implemented DSRC protocol. Are 1609.2, 1609.3 and 1609.4 standards fully implemented? If not, is there any resources to get their implementation code?
The official Veins website provides these information: http://veins.car2x.org/features/
Veins is an open-source tool available in GitHub: https://github.com/sommer/veins/releases or from the official site (given above)
1609.3 and 1609.4 are implemented, but not 1609.2.

Existing API for NLP in C++?

Is/are there existing C++ NLP API(s) out there? The closest thing I have found is CLucene, a port of Lucene. However, it seems a bit obsolete and the documentation is far from complete.
Ideally, this/these API(s) would permit tokenization, stemming and PoS tagging.
Freeling is written in C++ too, although most people just use their binaries to run the tools: http://devel.cpl.upc.edu/freeling/downloads?order=time&desc=1
Try something like DyNet, it's a generic neural net framework but most of its processes are focusing on NLP because the maintainers are creators of the NLP community.
Or perhaps Marian-NMT, it was designed for sequence-to-sequence model machine translation but potentially many NLP tasks can be structured as a sequence-to-sequence task.
Outdated
Maybe you can try Ellogon http://www.ellogon.org/ , they have GUI support and also C/C++ API for NLP too.
if you remove the restriction on c++ , you get the perfect NLTK (python)
the remaining effort is then interfacing between python and c++.
Apache Lucy would get you part of the way there. It is under active development.
Maybe you can use Weka-C++. It's the very popular Weka library for machine learning and data mining (including NLP) ported from Java to C++.
Weka supports tokenization and stemming, you'll probably need to train a classifier for PoS tagging.
I only used Weka with Java though, so I'm afraid can't give you more details on this version.
There is TurboParser by André Martins at CMU, also has a Python wrapper. There is is an online demo for it.
This project provides free (even for commercial use) state-of-the-art information extraction tools. The current release includes tools for performing named entity extraction and binary relation detection as well as tools for training custom extractors and relation detectors.
MITIE is built on top of dlib, a high-performance machine-learning library, MITIE makes use of several state-of-the-art techniques including the use of distributional word embeddings and Structural Support Vector Machines[3]. MITIE offers several pre-trained models providing varying levels of support for both English and Spanish, trained using a variety of linguistic resources (e.g., CoNLL 2003, ACE, Wikipedia, Freebase, and Gigaword). The core MITIE software is written in C++, but bindings for several other software languages including Python, R, Java, C, and MATLAB allow a user to quickly integrate MITIE into his/her own applications.
https://github.com/mit-nlp/MITIE

Recommendations for OpenGL / Scheme combination

I'd like to try out OpenGL programming in Scheme.
Can anyone give a recommendation for a decent Scheme compiler / OpenGL library combination?
I have no reservations, though it would be nice (but not a requirement) to be able to produce native, executable binaries — primarily on Windows, but also on UNIX and/or Mac OS X.
EDIT: Changed to community wiki, since the question does not have a definite answer I can accept. Thanks for the replies!
PLT Scheme includes OpenGL bindings in 2 forms, one that matches the C API, and one that's more "scheme" like in usage.
Update: PLT Scheme is now known as Racket, which also has OpenGL bindings.
Chicken Scheme has an egg that provides OpenGL bindings. IMHO, it's not well documented; if you are not familiar with OpenGL already, then this library isn't the right place to start learning.
Spark Scheme:
Spark-Scheme is a dialect of Lisp, which gives you...
Interactive, modular software development
Meta-programming facilities
Advanced control flow
Distributed computing
A comprehensive networking API
A modern GUI framework
2D/3D graphics
An SQL database engine and connectivity to third-party databases
A web server and a couple of web application frameworks
Gambit-C Has some "3rd party" Open GL bindings, available in the dumping grounds.

Experiences with Adobe's "Adam and Eve" C++ GUI library?

I tried out the demo application which was pretty impressive. However building it and integrating it with my own code is hard because it's such a large project.
Has anyone successfully used it for their own projects? Was is difficult to build and integrate with your own C++ code?
Link: STLab.
For the interested: there's also a Google Tech Talk clarifying the philosophical ideas behind the project.
ASL is used fairly heavily within Adobe. The layout library (Eve) is used in many Adobe products and variants of it have been in use since Photoshop 5. The property model library (Adam) got a little use in CS4 and will likely be used more in future products. I can no longer speak with certainty because I left Adobe a few months ago and am now working at Google. I still put in some time on ASL and continue to collaborate with Prof. Jarvi and some of his students on the property model library (see the paper on the ASL wiki).
It can be a bit difficult to integrate with your product. The platform libraries in ASL (backends to Adam and Eve for Windows and Mac Carbon) started as some small example code, then the community started to refine it (the Windows port was initially a community effort), then we had some ambition to make it a real, supported library. But then Apple dropped Carbon for 64 bits and Adobe's framework plans changed so we weren't able to leverage our efforts here inside Adobe. Because of this the platform libraries are a little shaky - if your code base is already using a framework you might consider integrating Adam and Eve directly (the API for both libraries is very small). There are two challenges with integrating with a framework. Eve needs good metrics to do a good layout, including things like baselines - getting that from your UI toolkit may be tough. The property model library assumes a strict model/view/controller pattern that most UI toolkits don't obey so you have to do a bit of adapting. Feel free to ask questions on the ASL mailing list. We can also help with building - it really isn't as complex as it seems.
I watched the Tech Talk.. He sort of lost me when he showed the real world example code and then a massively shorter version using his model... I suspect that his implementation, just like anything else, would in practice be bogged down by real world considerations if actually pursued to solve real problems...
That said, it was interesting... The first half of the talk was great... I especially liked his assertion that Generic programming is the mathematics of coding...