本文整理汇总了C++中outputs函数的典型用法代码示例。如果您正苦于以下问题:C++ outputs函数的具体用法?C++ outputs怎么用?C++ outputs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了outputs函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: rt_OneStep
/* Function: rtOneStep ========================================================
*
* Abstract:
* Perform one step of the model.
*/
static void rt_OneStep(RT_MODEL *S)
{
real_T tnext;
/***********************************************
* Check and see if error status has been set *
***********************************************/
if (rtmGetErrorStatus(S) != NULL) {
GBLbuf.stopExecutionFlag = 1;
return;
}
/* enable interrupts here */
tnext = rt_SimGetNextSampleHit();
rtsiSetSolverStopTime(rtmGetRTWSolverInfo(S),tnext);
outputs(S, 0);
rtExtModeSingleTaskUpload(S);
update(S, 0);
rt_SimUpdateDiscreteTaskSampleHits(rtmGetNumSampleTimes(S),
rtmGetTimingData(S),
rtmGetSampleHitPtr(S),
rtmGetTPtr(S));
if (rtmGetSampleTime(S,0) == CONTINUOUS_SAMPLE_TIME) {
rt_UpdateContinuousStates(S);
}
rtExtModeCheckEndTrigger();
} /* end rtOneStep */
开发者ID:Rick-B190,项目名称:Previous-Work,代码行数:33,代码来源:Client_main.c
示例2: QString
QString DMXUSB::outputInfo(quint32 output)
{
QString str;
if (output == QLCIOPlugin::invalidLine())
{
if (m_outputs.size() == 0)
{
str += QString("<BR><B>%1</B>").arg(tr("No output support available."));
str += QString("<P>");
str += tr("Make sure that you have your hardware firmly plugged in. "
"NOTE: FTDI VCP interface is not supported by this plugin.");
str += QString("</P>");
}
}
else if (output < quint32(m_outputs.size()))
{
str += QString("<H3>%1</H3>").arg(outputs()[output]);
str += QString("<P>");
str += tr("Device is operating correctly.");
str += QString("</P>");
QString add = m_outputs[output]->additionalInfo();
if (add.isEmpty() == false)
str += add;
}
str += QString("</BODY>");
str += QString("</HTML>");
return str;
}
开发者ID:Boudewijn26,项目名称:qlcplus,代码行数:31,代码来源:dmxusb.cpp
示例3: get
void Views::copyView(const std::string& viewname,
const std::string& copyname)
{
vpz::View view = get(viewname);
vpz::View copy = get(viewname);
copy.setName(copyname);
std::string copyoutputname;
int number = 1;
do {
copyoutputname = view.output() + "_";
copyoutputname += boost::lexical_cast< std::string >(number);
++number;
}while (outputs().exist(copyoutputname));
copyOutput(view.output(), copyoutputname);
switch (copy.type()) {
case vpz::View::TIMED:
addTimedView(copy.name(), copy.timestep(), copyoutputname);
break;
case vpz::View::EVENT:
addEventView(copy.name(), copyoutputname);
break;
case vpz::View::FINISH:
addFinishView(copy.name(), copyoutputname);
break;
}
}
开发者ID:alsabadel,项目名称:vle,代码行数:29,代码来源:Views.cpp
示例4: outputs
dmatrix3 ConvLayer::backpropagation() const
{
dmatrix3 outputs(Excitations.size(), dmatrix2
(Excitations[0].size(), dvec
(Excitations[0][0].size(), 0.0)));
ivec step;
step.reserve(4);
int index;
for(int z=0;z<Errors.size();z++) {
index = 0;
for(int y=0;y<Errors[0].size();y++) {
for(int x=0;x<Errors[0][0].size();x++, index++) {
step = Steps[index];
for(int i=step[0];i<step[1];i++) {
for(int j=step[2];j<step[3];j++) {
outputs[z][i][j] += sigmoid_p(
Excitations[z][i][j] *
Errors[z][y][x]);
}
}
}
}
}
return outputs;
}
开发者ID:zjucsxxd,项目名称:AdasCNN,代码行数:27,代码来源:ConvLayer.cpp
示例5: ensure_space_for_latent_data
// The imputation method is a "collapsed Gibbs sampler" that integrates out
// latent data from preceding layers (i.e. preceding nodes are activated
// probabilistically), but conditions on the latent data from the current
// layer and the layer above.
void GFFPS::impute_hidden_layer_outputs(RNG &rng) {
int number_of_hidden_layers = model_->number_of_hidden_layers();
if (number_of_hidden_layers == 0) return;
ensure_space_for_latent_data();
clear_latent_data();
std::vector<Vector> allocation_probs =
model_->activation_probability_workspace();
std::vector<Vector> complementary_allocation_probs = allocation_probs;
std::vector<Vector> workspace = allocation_probs;
for (int i = 0; i < model_->dat().size(); ++i) {
const Ptr<RegressionData> &data_point(model_->dat()[i]);
Nnet::HiddenNodeValues &outputs(imputed_hidden_layer_outputs_[i]);
model_->fill_activation_probabilities(data_point->x(), allocation_probs);
impute_terminal_layer_inputs(rng, data_point->y(), outputs.back(),
allocation_probs.back(),
complementary_allocation_probs.back());
for (int layer = number_of_hidden_layers - 1; layer > 0; --layer) {
// This for-loop intentionally skips layer 0, because the inputs to the
// first hidden layer are the observed predictors.
imputers_[layer].impute_inputs(
rng,
outputs,
allocation_probs[layer - 1],
complementary_allocation_probs[layer - 1],
workspace[layer - 1]);
}
imputers_[0].store_initial_layer_latent_data(outputs[0], data_point);
}
}
开发者ID:cran,项目名称:Boom,代码行数:33,代码来源:GaussianFeedForwardPosteriorSampler.cpp
示例6: qIdsForNodes
Qt3DCore::QNodeCreatedChangeBasePtr QRenderTarget::createNodeCreationChange() const
{
auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QRenderTargetData>::create(this);
auto &data = creationChange->data;
data.outputIds = qIdsForNodes(outputs());
return creationChange;
}
开发者ID:RSATom,项目名称:Qt,代码行数:7,代码来源:qrendertarget.cpp
示例7: eval
void eval(int num, array **arrays)
{
std::vector<af_array> outputs(num);
for (int i = 0; i < num; i++) {
outputs[i] = arrays[i]->get();
}
AF_THROW(af_eval_multiple(num, &outputs[0]));
}
开发者ID:FloopCZ,项目名称:arrayfire,代码行数:8,代码来源:array.cpp
示例8: rt_context_update
void node::rt_context_update (rt_process_context& ctx)
{
for (auto& in : inputs ())
in.rt_context_update (ctx);
for (auto& out : outputs ())
out.rt_context_update (ctx);
rt_on_context_update (ctx);
}
开发者ID:EQ4,项目名称:psychosynth,代码行数:8,代码来源:node.cpp
示例9: outputs
static EORB_CPP_node *read_expr_8 (void)
{
EORB_CPP_node *l;
EORB_CPP_node *r;
char c;
#ifdef DEBUG_EXPR
if (debugging)
{
outputs("~E8:");
}
#endif
l = read_expr_9();
while (1)
{
c = getnhsexpand();
switch (c)
{
case '+':
case '-':
#ifdef DEBUG_EXPR
if (debugging)
{
outputc(c);
}
#endif
r = read_expr_9();
l = newnode(l, c, r);
break;
default:
#ifdef DEBUG_EXPR
if (debugging)
{
outputs("~");
}
#endif
Push(c);
return (l);
break;
}
}
}
开发者ID:S73417H,项目名称:opensplice,代码行数:45,代码来源:expr.c
示例10: updateCached
void updateCached()
{ ScalarFieldArray N;
FluidMixture::Outputs outputs(&N, 0, &Adiel_rhoExplicitTilde, 0, &Adiel);
fluidMixture->getFreeEnergy(outputs); //Fluid free energy including coupling
Ntilde.resize(N.size());
for(unsigned i=0; i<N.size(); i++)
Ntilde[i] = J(N[i]);
}
开发者ID:yalcinozhabes,项目名称:pythonJDFTx,代码行数:9,代码来源:FluidSolver.cpp
示例11: gradient
void gradient(View& view, const Eigen::VectorXd& parameters, Eigen::VectorXd& gradient_vector)
{
// TODO: Check concept for InputIterator
//double N = std::distance(first_input, last_input);
double scaling_factor = 1. / view.size();
gradient_vector.setZero();
// DEBUG
//std::cout << gradient_ << std::endl;
for (unsigned int i = 0; i < view.size(); i++) {
forward_propagation(parameters, view.first(i), outputs());
back_propagation_error(parameters, view.first(i), outputs(), view.second(i), gradient_vector, scaling_factor);
}
// DEBUG
//std::cout << gradient_ << std::endl;
}
开发者ID:stefanwebb,项目名称:neural-networks,代码行数:19,代码来源:multilayer_perceptron.hpp
示例12: split
//! split une liste de signaux sur n bus
siglist split(const siglist& inputs, int nbus)
{
int nlines = (int)inputs.size();
siglist outputs(nbus);
for (int b=0; b<nbus; b++) {
outputs[b] = inputs[b % nlines];
}
return outputs;
}
开发者ID:EBone,项目名称:Faust,代码行数:12,代码来源:propagate.cpp
示例13: main
task main()
{
int myval2 = 2; // defined as local to task main()(preferred)
int myval3 = 3;
inputs(myval1);
processing(myval2);
outputs(myval3);
}
开发者ID:profjrr,项目名称:Profjrr_OETC_RoboticsWorkshop_2016,代码行数:11,代码来源:shell1.c
示例14: assert
std::vector<double> nevil::basic_feedforward_nn::update(const std::vector<double> &inputs)
{
assert ((_num_input_nodes == inputs.size())
&& "Error: matrix size and input size don't match!");
std::vector<double> outputs(_num_output_nodes, 0);
for (std::size_t i = 0; i < _num_output_nodes; ++i)
for (std::size_t j = 0; j < _num_input_nodes; ++j)
outputs[i] += _weights[(i * _num_input_nodes) + j] * inputs[j];
return outputs;
}
开发者ID:ou-real,项目名称:nevil-base,代码行数:11,代码来源:basic_feedforward_nn.cpp
示例15: check
Vector<double> MeanSquaredError::calculate_terms(void) const {
// Control sentence
#ifndef NDEBUG
check();
#endif
// Neural network stuff
const MultilayerPerceptron* multilayer_perceptron_pointer =
neural_network_pointer->get_multilayer_perceptron_pointer();
const unsigned inputs_number =
multilayer_perceptron_pointer->get_inputs_number();
const unsigned outputs_number =
multilayer_perceptron_pointer->get_outputs_number();
// Data set stuff
const Instances& instances = data_set_pointer->get_instances();
const unsigned training_instances_number =
instances.count_training_instances_number();
// Mean squared error stuff
Vector<double> performance_terms(training_instances_number);
Vector<double> inputs(inputs_number);
Vector<double> outputs(outputs_number);
Vector<double> targets(outputs_number);
for (unsigned i = 0; i < training_instances_number; i++) {
// Input vector
inputs = data_set_pointer->get_training_input_instance(i);
// Output vector
outputs = multilayer_perceptron_pointer->calculate_outputs(inputs);
// Target vector
targets = data_set_pointer->get_training_target_instance(i);
// Error
performance_terms[i] = outputs.calculate_distance(targets);
}
return (performance_terms / sqrt((double)training_instances_number));
}
开发者ID:jrdodson,项目名称:opennn,代码行数:54,代码来源:mean_squared_error.cpp
示例16: work
void work(void)
{
float *out = outputs()[0]->buffer();
const float *in0 = inputs()[0]->buffer();
const size_t elems = this->workInfo().minElements;
for (size_t i = 1; i < inputs().size(); i++)
{
const float *in = inputs()[i]->buffer();
for (size_t n = 0; n < elems; n++)
{
out[n] = in0[n] + in[n];
}
in0 = out; //setup for next loop
inputs()[i]->consume(elems);
}
inputs()[0]->consume(elems);
outputs()[0]->produce(elems);
}
开发者ID:pothosware,项目名称:pothos,代码行数:20,代码来源:TestWorker.cpp
示例17: QString
QString GPIOPlugin::outputInfo(quint32 output)
{
QString str;
if (output == 0)
str += QString("<H3>%1</H3>").arg(outputs()[output]);
str += QString("</BODY>");
str += QString("</HTML>");
return str;
}
开发者ID:boxy321,项目名称:qlcplus,代码行数:12,代码来源:gpioplugin.cpp
示例18: outputs
std::string TrainProcessor::processInput(const std::string &input) {
cv::Mat samples, categories;
if (!fillSamples(input, samples, categories)) {
return "Unable to load samples from file";
}
const int inputSize = myCvPCA.eigenvalues.rows;
const int outputSize = myClassesList.length();
cv::Mat inputs;
myCvPCA.project(samples, inputs);
cv::Mat outputs(samples.rows, outputSize, CV_32FC1);
outputs = 0.0f;
for (int i = 0; i < categories.rows; ++i) {
char cat = categories.at<unsigned char>(i, 0);
int index = (int) myClassesList.find(cat);
outputs.at<float>(i, index) = 1.0f;
}
int layers = (myLayersCount > 0) ? myLayersCount : std::max(3, (int)(inputSize * myLayersScale));
std::cout << std::endl;
std::cout << "Layers number = " << layers << std::endl;
cv::Mat layerSizes(1, layers, CV_32SC1);
--layers;
std::cout << "Layer sizes: " << inputSize;
layerSizes.at<int>(0, 0) = inputSize;
for (int i = 1; i < layers; ++i) {
const float scale = myLayersSizeScale + (1.0f - myLayersSizeScale) * (i-1) / (layers-1);
const int sz = (int)(scale * (inputSize + (outputSize - inputSize) * i / layers));
std::cout << " " << sz;
layerSizes.at<int>(0, i) = sz;
}
std::cout << " " << outputSize << std::endl;
layerSizes.at<int>(0, layers) = outputSize;
std::cout << std::endl;
double timer = (double)cv::getTickCount();
myCvMLP.create(layerSizes, CvANN_MLP::SIGMOID_SYM, 1.0, 1.0);
myCvMLP.train(inputs, outputs, cv::Mat(), cv::Mat(), CvANN_MLP_TrainParams(), 0);
timer = (double)cv::getTickCount() - timer;
std::cout << "Training time = " << (timer / cv::getTickFrequency()) << " s" << std::endl;
std::cout << std::endl;
return "";
}
开发者ID:vasiliy-bout,项目名称:emorec,代码行数:53,代码来源:TrainProcessor.cpp
示例19: feeding
void pcnn::calculate_states(const pcnn_stimulus & stimulus) {
std::vector<double> feeding(size(), 0.0);
std::vector<double> linking(size(), 0.0);
std::vector<double> outputs(size(), 0.0);
for (unsigned int index = 0; index < size(); index++) {
pcnn_oscillator & current_oscillator = m_oscillators[index];
std::vector<unsigned int> neighbors;
get_neighbors(index, neighbors);
double feeding_influence = 0.0;
double linking_influence = 0.0;
for (std::vector<unsigned int>::const_iterator iter = neighbors.begin(); iter != neighbors.end(); iter++) {
const double output_neighbor = m_oscillators[(*iter)].output;
feeding_influence += output_neighbor * m_params.M;
linking_influence += output_neighbor * m_params.W;
}
feeding_influence *= m_params.VF;
linking_influence *= m_params.VL;
feeding[index] = m_params.AF * current_oscillator.feeding + stimulus[index] + feeding_influence;
linking[index] = m_params.AL * current_oscillator.linking + linking_influence;
/* calculate internal activity */
double internal_activity = feeding[index] * (1.0 + m_params.B * linking[index]);
/* calculate output of the oscillator */
if (internal_activity > current_oscillator.threshold) {
outputs[index] = OUTPUT_ACTIVE_STATE;
}
else {
outputs[index] = OUTPUT_INACTIVE_STATE;
}
}
/* fast linking */
if (m_params.FAST_LINKING) {
fast_linking(feeding, linking, outputs);
}
/* update states of oscillators */
for (unsigned int index = 0; index < size(); index++) {
pcnn_oscillator & oscillator = m_oscillators[index];
oscillator.feeding = feeding[index];
oscillator.linking = linking[index];
oscillator.output = outputs[index];
oscillator.threshold = m_params.AT * oscillator.threshold + m_params.VT * outputs[index];
}
}
开发者ID:chenyfcitc,项目名称:pcnn_simple,代码行数:53,代码来源:pcnn.cpp
示例20: outputs
void Xnor::updateLogic( ) {
char res = false;
if( !isValid( ) ) {
res = -1;
}
else {
for( QNEPort *input : inputs( ) ) {
res = res ^ input->value( );
}
res = !res;
}
outputs( ).first( )->setValue(res);
}
开发者ID:G4merBR,项目名称:Guitar-Panda,代码行数:13,代码来源:xnor.cpp
注:本文中的outputs函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论