Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output clg #229

Merged
merged 53 commits into from
Oct 9, 2016
Merged

Output clg #229

merged 53 commits into from
Oct 9, 2016

Conversation

xh3b4sd
Copy link
Collaborator

@xh3b4sd xh3b4sd commented Sep 25, 2016

abstract

This PR goes towards #172.

fixes

This PR fixes #193.

checklist

  • Make sure you read and understood the CONTRIBUTING.md.
  • Make sure you applied sufficient labels, milestone and assignee.
  • Make sure all TODOs are addressed.
  • Make sure there is sufficient documentation.
  • Make sure there are sufficient tests.
  • Make sure all commits are squashed before merging.
  • Make sure to delete the feature branch after merging.

@xh3b4sd xh3b4sd self-assigned this Sep 25, 2016
SessionID string
Context netcontext.Context
Expectation spec.Expectation
SessionID string

// TODO we want to track the original input that was provided from the
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original input needs to be tracked to forward the correct network payload from the output CLG to the input CLG in case a provided expectation was not met.

Copy link
Collaborator Author

@xh3b4sd xh3b4sd Oct 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we lookup the original input using the information ID tracked in the context and send it to the input CLG referenced by the CLG tree ID tracked by the context.

@@ -28,6 +28,9 @@ func (n *network) payloadFromConnections(behaviorID string, queue []spec.Network
// storage. Here it is important to obtain the order of the behavior IDs
// stored as connections. They represent the input interface of the requested
// CLG.
//
// TODO there needs to be some sort of variation when executing existing CLG trees
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add variations to the selection process of network payloads being merged together. The requested CLG needs to be executed with different inputs from time to time, regardless known successful configurations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation changed. There is now spec.Activator to manage the activation process.

// within several CLGs. That way the network creates its own connections
// based on learned experiences.
//
// TODO where are these connections coming from?
Copy link
Collaborator Author

@xh3b4sd xh3b4sd Sep 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add a comment.

There are no known connections when executing a new CLG tree. The first execution of a CLG tree records some sort of event log. Connections are only known beginning with the second execution of the same CLG tree. Then a replay of the recorded event log can be done.

Copy link
Collaborator Author

@xh3b4sd xh3b4sd Oct 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation changed. There is now spec.Forwarder to manage the forwarding process.

// based on learned experiences.
//
// TODO where are these connections coming from?
// TODO if there are none, we need to find some randomly
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to create new connections in case there are none.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation changed. There is now spec.Forwarder to manage the forwarding process.

//
// TODO where are these connections coming from?
// TODO if there are none, we need to find some randomly
// TODO there needs to be some sort of variation when executing existing CLG trees
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if there are connections stored, we need to add variations to the selection process. That way known CLG trees can be improved.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation changed. There is now spec.Forwarder to manage the forwarding process.

}

// TODO fetch CLG tree ID using information ID
// TODO fetch input CLG ID (behaviorID) using CLG tree ID
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to lookup the behavior ID of the input CLG of the current CLG tree. Using this behavior ID we can forward the network payload from the output CLG to the input CLG.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation changed. There is now spec.Forwarder to manage the forwarding process.

n.Log.WithTags(spec.Tags{C: nil, L: "E", O: n, V: 4}, "%#v", maskAny(err))
continue
}
// TODO write a new CLG tree ID and add it to context
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to create a new CLG tree ID and connect it with the behavior ID of the input CLG.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@codecov-io
Copy link

codecov-io commented Sep 25, 2016

Current coverage is 89.90% (diff: 62.18%)

Merging #229 into master will decrease coverage by 3.57%

Powered by Codecov. Last update ad4ee8e...db16f0a

@@ -15,8 +15,11 @@ import (
type key string

const (
behaviorIDKey key = "behavior-id"
// TODO make the context marshalable
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make the context marshalable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

not clean. I now pursue an approach using a task system. I think this will give
more controle over the communication processes within the neural network.

TODO
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to write the diary.

@@ -4,6 +4,8 @@ import (
"fmt"
)

// TODO rename to NetworkKeyFormat, NewNetworkKey
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to rename CLGKeyFormat to NetworkKeyFormat, etc..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

return nil, maskAnyf(invalidBehaviourIDError, "must not be empty")
}
behaviourIDsKey := key.NewCLGKey("forward:configuration:behaviour-id:%s:behaviour-ids", behaviourID)
// TODO add closer instead of nil
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using the closer we should check if the set methods make sense to be used here. Further there should be a method to fetch all elements of a set at once. The forwarder limits the number of elements stored per CLG anyway, so walking the elements of a set incrementally is not necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is now a spec.Storage.GetAllFromSet method.

return newNetworkPayloads, nil
}

// TODO this should probably be moved to the output CLG
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should move this probably to the output CLG.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// NewNetworkPayloads
//
// TODO
Forward(CLG CLG, networkPayload NetworkPayload) error
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need more documentation here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// TODO
EventListener(canceler <-chan struct{}) error

// TODO
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write more docs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -203,6 +202,26 @@ func (s *storage) GetStringMap(key string) (map[string]string, error) {
return nil, notFoundError
}

// TODO
func (s *storage) PopFromList(key string) (string, error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -244,6 +244,54 @@ func (s *storage) GetStringMap(key string) (map[string]string, error) {
return result, nil
}

// TODO
func (s *storage) PopFromList(key string) (string, error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@xh3b4sd
Copy link
Collaborator Author

xh3b4sd commented Oct 8, 2016

The PR is huge again. We stop here. The only additional thing left is now writing a diary entry. The next step is to add the event tracker to create more connections and make the forwarder actually work.

@xh3b4sd
Copy link
Collaborator Author

xh3b4sd commented Oct 9, 2016

LGTM

@xh3b4sd xh3b4sd merged commit 6b5c0bc into master Oct 9, 2016
@xh3b4sd xh3b4sd deleted the output-clg branch October 9, 2016 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement the output CLG
2 participants