<commit_before>// a simple neural network example using automatic differentiation
package nn

import (
	"flag"
	"fmt"
	"os"
)

//go:generate run nn -gen
//go:generate run compile -formula=nn.txt -output nn_ad.go -templates "../ad/parser/templates" -package nn -main=false -time=false
func Run(args []string) {
	var gen bool
	flags := flag.NewFlagSet("parse", flag.ExitOnError)
	flags.BoolVar(&gen, "gen", false, "whether to generate formula")
	flags.Parse(args)
	fmt.Println("generating formula")
	f, err := os.Create("nn.txt")
	check(err)
	defer f.Close()
	fmt.Fprintf(f, "f := a+b\n")
}

func check(e error) {
	if e != nil {
		panic(e)
	}
}<commit_msg>specifying neural network<commit_after>// a simple neural network example using automatic differentiation
package nn

import (
	"flag"
	"fmt"
	"os"
)

//go:generate run nn -gen
//go:generate run compile -formula=nn.txt -output nn_ad.go -templates "../ad/parser/templates" -package nn -main=false -time=false
func Run(args []string) {
	var gen bool
	var nclass, hidden, inputs int
	flags := flag.NewFlagSet("parse", flag.ExitOnError)
	flags.BoolVar(&gen, "gen", false, "whether to generate formula")
	flags.IntVar(&inputs, "inputs", 2, "number of inputs")
	flags.IntVar(&nclass, "classes", 3, "number of classes")
	flags.IntVar(&hidden, "hidden", 3, "number of hidden units")
	flags.Parse(args)
	if gen {
		fmt.Println("generating formula")
		f, err := os.Create("nn.txt")
		check(err)
		defer f.Close()
		fmt.Fprintf(f, "f := a+b\n")
		return
	}
}

func check(e error) {
	if e != nil {
		panic(e)
	}
}
{'fraction_non_alphanumeric': 0.16012861736334405, 'fraction_numerical': 0.0019292604501607716, 'mean_word_length': 4.1866666666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2801778', 'n_tokens_mistral': 573, 'n_tokens_neox': 554, 'n_words': 161}