Ejemplo n.º 1
0
/*! Return a string suitable for graphviz output.
 */
std::string fn::hmm::detail::deterministic_node::graphviz() {
    std::ostringstream out;
    out << "[shape=record,label=\"{inputs | ";
    
    for(int i=0; i<num_inputs(); ++i) {
        out << xinput(i) << " ";
    }
    
    for(int i=0; i<(1<<num_inputs()); ++i) {
        out << "| " << std::bitset<4>(i) << " ";
    }
    
    out << "} | { outputs | ";
    for(int i=0; i<num_outputs(); ++i) {
        out << xoutput(i) << " ";
    }

    for(int i=0; i<(1<<num_inputs()); ++i) {
        out << "| " << std::bitset<4>(dtable(i)) << " ";
    }
    
    out << "}\"];";
    
    return out.str();
}
Ejemplo n.º 2
0
        const tensor_t& model_t::output(const vector_t& input) const
        {
                assert(static_cast<size_t>(input.size()) == isize());

                tensor_t xinput(idims(), irows(), icols());
                xinput.vector() = input;

                return output(xinput);
        }