Coder Social home page Coder Social logo

consciousness's People

Contributors

kingjr avatar virgil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

consciousness's Issues

new operations

Dear Virgil,
I'm a student in Tononi lab and I've started to use your code for calculating 
Phi for some simple 
systems. Unfortunately, I need some more operations (especially AND for 3 and 4 
inputs, XOR for 
three inputs). I've therefore slightly modified your code to allow such 
operations, and changed 
the format of circuit.
Here's the changes I've made:

In t_consc.h:
Line 26, struct t_transformation:        
int A, B, C, D;

-----------------------------------------------------------
In t_consc.cpp:
Line 1097 and following, void t_consciousness::load_transformations: 
//READIN CIRCUIT NETWORK
    else if( this->networktype == "circuit" )
    {
        t_transformation t;
        int I,A,B,C,D;
        char op;
        while(!(feof(f))){
            fscanf(f,"%i    =   %c  ",&I,&op);  //%i    %i  %i  %i\n,&I,&op,&A,&B,&C,&D);
//          t.A=(unsigned char)A;
//          t.B=(unsigned char)B;
            switch(op){
                case 'A':
                case 'O':
                case 'X':
                    fscanf(f,"%i    %i\n",&A,&B);
                    t.A=A;
                    t.B=B;
                    break;
                case 'E':
                case 'N':
                    fscanf(f,"%i\n",&A);
                    t.A=A;
                    break;
                case 'S':
                case 'C':
                    fscanf(f,"%i    %i  %i\n",&A,&B,&C);
                    t.A=A;
                    t.B=B;
                    t.C=C;
                    break;
                case 'D':
                    fscanf(f,"%i    %i  %i  %i\n",&A,&B,&C,&D);
                    t.A=A;
                    t.B=B;
                    t.C=C;
                    t.D=D;
                    break;
            }
            switch(op){
                case 'A':t.operation=0; break; //AND
                case 'O':t.operation=1; break; //OR
                case 'X':t.operation=2; break; //XOR
                case 'E':t.operation=3; break; //COPY
                case 'N':t.operation=4; break; //NOT
                case 'S':t.operation=5; break; //AND3
                case 'C':t.operation=6; break; //XOR3
                case 'D':t.operation=7; break; //AND4
            }
            transformations.push_back(t);
        }

-----------------------------------------------------
In void t_consciousness::make_all_states:

switch(transformations[j].operation){
                    case 0://AND
                        p=((x0>>transformations[j].A)&1)&&((x0>>transformations[j].B)&1);
                        break;
                    case 1://OR
                        p=((x0>>transformations[j].A)&1)||((x0>>transformations[j].B)&1);
                        break;
                    case 2://XOR
                        p=((x0>>transformations[j].A)&1)^((x0>>transformations[j].B)&1);
                        break;
                    case 3://EQUAL
                        p=(x0>>transformations[j].A)&1;
                        break;
                    case 4://NOT
                        p=((x0>>transformations[j].A)&1);
                        break;
                    case 5://AND3

p=((x0>>transformations[j].A)&1)&&((x0>>transformations[j].B)&1)&&((x0>>transfor
mations[j].
C)&1);
                        break;
                    case 6://XOR3

p=((x0>>transformations[j].A)&1)+((x0>>transformations[j].B)&1)+((x0>>transforma
tions[j].C)
&1);
                        if (p==1)
                            p=1;
                        else
                            p=0;
                        break;
                    case 7://AND4

p=((x0>>transformations[j].A)&1)&&((x0>>transformations[j].B)&1)&&((x0>>transfor
mations[j].
C)&1)&&((x0>>transformations[j].D)&1);
                        break;
                    default:
                        cerr << "Error: Did not understand specified transformation!";
                        exit(-1);
                }

----------------------------------------------------------------------

Let me know if you think these changes could be applied to you program.
Thanks a lot.
Best regards

Umberto

Original issue reported on code.google.com by [email protected] on 5 May 2009 at 7:01

extra folder in address of repository

The address given for the repository in the source/checkout page, in the 
command-line-access paragraph, is 
http://consciousness.googlecode.com/svn/trunk/, instead of 
http://consciousness.googlecode.com/svn/.

Thanks,
Abel

Original issue reported on code.google.com by [email protected] on 13 Apr 2012 at 5:57

problem for Phi calculation with wire perturbation and Tononi normalization / problem when printing Phi for each state

I've been using an older version of the code for some time, always getting 
correct results (see Issue 
1 for some modifications I made). The latest version, however, seems to give 
uncorrect results when 
using wire perturbation and Tononi normalization (I can calculate Phi values in 
this way with 
different programs). I tested a simple AND gate with 2 inputs, running do.py.


Moreover, setting the flag for printing Phi values for each distinct state 
seems to give some issues 
as, for some systems, the program exits before completion.

Thanks,

Umberto

Original issue reported on code.google.com by [email protected] on 4 Jun 2009 at 9:44

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.