ui

package
v0.0.0-...-98db5b7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2020 License: CC-BY-4.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDifLossHandler

func NewDifLossHandler(title string, LossData <-chan []LabelFloat2, epoc bool, plotlengths int, labels ...string) (*DifLossHandler, []LabelFloat2)

NewDifLossHandler Makes a VSLoss Handle. If epoc is true it will label the x axis as epoc. Otherwise it will label it batch. Just make sure you are passing the right amount of data through the LossData Channel. So, the axis is labeled correctly. Y axis will be labeled Loss.

func NewVSLossHandle

func NewVSLossHandle(title string, ceiling float32, LossData <-chan []LabelFloat, epoc bool, epocsize, batchskip int, labels ...string) (*VSLossHandler, []LabelFloat)

NewVSLossHandle Makes a VSLoss Handle. If epoc is true it will label the x axis as epoc. Otherwise it will label it batch. Just make sure you are passing the right amount of data through the LossData Channel. So, the axis is labeled correctly. Y axis will be labeled Loss.

func ServerMain

func ServerMain(windows Windows)

ServerMain is the test server with just a bunch of images from the harddrive

Types

type DifLossHandler

type DifLossHandler struct {
	Plots io.WriterTo
	// contains filtered or unexported fields
}

DifLossHandler draws a vs chart for loss. You might want to put several things in it like Training Loss Vs Testing Loss.

func (*DifLossHandler) ChangeHW

func (l *DifLossHandler) ChangeHW(h, w int)

ChangeHW changes the Height and Width of the Plot default is h= 6 cm, and w = 12 cm

func (*DifLossHandler) Handle

func (l *DifLossHandler) Handle() func(w http.ResponseWriter, req *http.Request)

Handle is used for the web handler

type DivOutputs

type DivOutputs struct {
	Header string
	URL    string
	PURL   string
	ID     string
	PID    string
	Name   string
	ColWid string
	NewRow template.HTML
	EndRow template.HTML
	Func   template.JS
	MyVar  template.JS
	Rate   template.JS
}

DivOutputs is a struct that helps build a dynamic output for the ui

type Handler

type Handler interface {
	Handle() func(http.ResponseWriter, *http.Request)
}

Handler interface. This is the cool way to control data without having a global variables. example:

   (s *slideshow)Handle()func(w http.ResponseWriter, req *http.Request){
		return  func( w http.ResponseWriter, req *http.Request){
		err:=	jpeg.Encode(w, s.img[s.index%len(s.img)], nil)
		if err !=nil{panic(err)}
		s.index++
		}
}

type HardwareCharts

type HardwareCharts struct {
	Header string
	URL    string
	ID     string
	Name   string
	ColWid string
	NewRow template.HTML
	EndRow template.HTML
	Func   template.JS
	MyVar  template.JS
	Rate   template.JS
}

HardwareCharts is a struct that contains the necissary values to make a chart

type ImageHandler

type ImageHandler struct {
	// contains filtered or unexported fields
} /*
//MakeImageHandler makes a new image handler
func MakeImageHandlerV2(bufferlen int, img <-chan image.Image, buffersize chan<- int) (*ImageHandler, chan<-image.Image ,<-chan int {

	x := &ImageHandler{}
	x.img = make([]image.Image, bufferlen)
	x.size = bufferlen
	go x.runchannel(img, buffersize)
	return x
}
*/

ImageHandler takes

func MakeImageHandler

func MakeImageHandler(bufferlen int, img <-chan image.Image, buffersize chan<- int) *ImageHandler

MakeImageHandler makes a new image handler

func (*ImageHandler) Handle

func (l *ImageHandler) Handle() func(w http.ResponseWriter, req *http.Request)

Handle is the function that returns the handle function

type ImageHandlerV2

type ImageHandlerV2 struct {
	// contains filtered or unexported fields
}

ImageHandlerV2 takes

func MakeImageHandlerV2

func MakeImageHandlerV2(bufferlen int, initimagelocation string) *ImageHandlerV2

MakeImageHandlerV2 makes a new image handler

func (*ImageHandlerV2) Buffer

func (l *ImageHandlerV2) Buffer() <-chan int

Buffer returns the buffer channel

func (*ImageHandlerV2) Handle

func (l *ImageHandlerV2) Handle() func(w http.ResponseWriter, req *http.Request)

Handle is the function that returns the handle function

func (*ImageHandlerV2) Image

func (l *ImageHandlerV2) Image(image image.Image)

Image works like Sprintf sending messages through a hidden channel

type IndexTemplate

type IndexTemplate struct {
	HardwareCharts []HardwareCharts
	DivOutputs     []DivOutputs
	Stats          []Stats
}

IndexTemplate is the indexed template of the networks

type LabelFloat

type LabelFloat struct {
	Label string
	Data  float32
}

LabelFloat is used to pass data through channels to the VSLossHandler

type LabelFloat2

type LabelFloat2 struct {
	Label string
	Data  []float32
}

LabelFloat2 wraps a label (string) and data (float array)

type ParagraphHandler

type ParagraphHandler struct {
	// contains filtered or unexported fields
}

ParagraphHandler takes

func MakeParagraphHandler

func MakeParagraphHandler(bufferlen int, paragraph <-chan string, buffersize chan<- int) *ParagraphHandler

MakeParagraphHandler makes a new image handler

func (*ParagraphHandler) Handle

func (l *ParagraphHandler) Handle() func(w http.ResponseWriter, req *http.Request)

Handle is the function that returns the handle function

type ParagraphHandlerV2

type ParagraphHandlerV2 struct {
	// contains filtered or unexported fields
}

ParagraphHandlerV2 is the handler for the ui

func MakeParagraphHandlerV2

func MakeParagraphHandlerV2(bufferlen int) *ParagraphHandlerV2

MakeParagraphHandlerV2 makes a new image handler

func (*ParagraphHandlerV2) Buffer

func (l *ParagraphHandlerV2) Buffer() <-chan int

Buffer returns the buffer channel

func (*ParagraphHandlerV2) Handle

func (l *ParagraphHandlerV2) Handle() func(w http.ResponseWriter, req *http.Request)

Handle is the function that returns the handle function

func (*ParagraphHandlerV2) Paragraph

func (l *ParagraphHandlerV2) Paragraph(format string, a ...interface{})

Paragraph works like Sprintf sending messages through a hidden channel

type Stats

type Stats struct {
	Header string
	PURL   string
	PID    string
	Name   string
	ColWid string
	NewRow template.HTML
	EndRow template.HTML
	Func   template.JS
	MyVar  template.JS
	Rate   template.JS
}

Stats are the minmaxes of the network layers or hidden io

type URLs

type URLs struct {
	// contains filtered or unexported fields
}

URLs are the urls for the

type VSLossHandler

type VSLossHandler struct {
	Plots io.WriterTo
	// contains filtered or unexported fields
}

VSLossHandler draws a vs chart for loss. You might want to put several things in it like Training Loss Vs Testing Loss.

func (*VSLossHandler) ChangeHW

func (l *VSLossHandler) ChangeHW(h, w int)

ChangeHW changes the Height and Width of the Plot default is h= 6 cm, and w = 12 cm

func (*VSLossHandler) Handle

func (l *VSLossHandler) Handle() func(w http.ResponseWriter, req *http.Request)

Handle is the func used for the web handler

type Windows

type Windows struct {
	// contains filtered or unexported fields
}

Windows are the ui sections of the network

func NewWindows

func NewWindows(ipaddress, port, page string) Windows

NewWindows creates allows the user to create a bunch of windows to access the neural network if "localhost" is passed in ipaddress called then it will open a browser for you automatically.

func (*Windows) AddHardwareCharts

func (w *Windows) AddHardwareCharts(header, refreshrate, url string, handle Handler, columnsinrow int, beginrow bool, endofrow bool)

AddHardwareCharts adds the hardware charts to the ui for mem temp and power

func (*Windows) AddNetIO

func (w *Windows) AddNetIO(header, refreshrate, url string, uh Handler, purl string, up Handler, columnsinrow int, beginrow, endofrow bool)

AddNetIO adds a window to the ui

func (*Windows) AddStats

func (w *Windows) AddStats(header, refreshrate, purl string, up Handler, columnsinrow int, beginrow, endofrow bool)

AddStats adds a window to the ui

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL