diff --git a/README.md b/README.md index 4f3fab6..aa8b69b 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ FileNest/ ```bash # Clone the repository -git clone https://github.com/lakshyajain-0291/FileNest.git +git clone https://github.com/AISocietyIITJ/FileNest.git cd FileNest # Set up backend dependencies diff --git a/UDPmsg/go.mod b/UDPmsg/go.mod new file mode 100644 index 0000000..ffb16e0 --- /dev/null +++ b/UDPmsg/go.mod @@ -0,0 +1,3 @@ +module UDPmsg + +go 1.24.4 diff --git a/UDPmsg/peer1/main.go b/UDPmsg/peer1/main.go new file mode 100644 index 0000000..3f122f4 --- /dev/null +++ b/UDPmsg/peer1/main.go @@ -0,0 +1,93 @@ +package main + +import ( + "bufio" + "fmt" + "log" + "net" + "os" + "strings" + "sync" + "time" +) + + +func listenmsg(listener *net.UDPConn, wg *sync.WaitGroup) { + defer wg.Done() + listen := make([]byte, 2048) + for { + n, remoteaddr, err := listener.ReadFromUDP(listen) + if err != nil { + log.Fatal(err) + } + message := string(listen[:n]) + fmt.Printf("Read a message from %v %s \n", remoteaddr, message) + } +} + +func sendmsg(peerAddr *net.UDPAddr, conn *net.UDPConn, wg *sync.WaitGroup) { + defer wg.Done() + scanner := bufio.NewScanner(os.Stdin) + for { + fmt.Printf("Please enter your message: ") + if !scanner.Scan() { + break + } + + message := strings.TrimSpace(scanner.Text()) + + if message != "" { + _, err := conn.WriteToUDP([]byte(message), peerAddr) + if err != nil { + fmt.Printf("Error sending message: %v\n", err) + } else { + fmt.Printf("Sent: %s\n", message) + } + } + + time.Sleep(100 * time.Millisecond) + } +} + +func main() { + // Get local address + myAddr := &net.UDPAddr{ + Port: 4321, + IP: net.ParseIP("127.0.0.1"), + } + + // Create UDP listener + listener, err := net.ListenUDP("udp", myAddr) + if err != nil { + log.Fatalf("Failed to create UDP listener: %v", err) + } + + fmt.Printf("Listening on %s\n", myAddr.String()) + + // Get peer address + var ip, port string + fmt.Print("Enter peer's IP address: ") + fmt.Scan(&ip) + fmt.Print("Enter peer's port: ") + fmt.Scan(&port) + + peerAddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%s:%s", ip, port)) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Peer address: %s\n", peerAddr.String()) + + // Use WaitGroup to coordinate goroutines + var wg sync.WaitGroup + wg.Add(2) + + // Start listening and sending goroutines + go listenmsg(listener, &wg) + go sendmsg(peerAddr, listener, &wg) + + // Wait for both goroutines to finish + wg.Wait() + fmt.Println("Program ended") + +} diff --git a/UDPmsg/peer2/main.go b/UDPmsg/peer2/main.go new file mode 100644 index 0000000..c1a5134 --- /dev/null +++ b/UDPmsg/peer2/main.go @@ -0,0 +1,93 @@ +package main + +import ( + "bufio" + "fmt" + "log" + "net" + "os" + "strings" + "sync" + "time" +) + + +func listenmsg(listener *net.UDPConn, wg *sync.WaitGroup) { + defer wg.Done() + listen := make([]byte, 2048) + for { + n, remoteaddr, err := listener.ReadFromUDP(listen) + if err != nil { + log.Fatal(err) + } + message := string(listen[:n]) + fmt.Printf("Read a message from %v %s \n", remoteaddr, message) + } +} + +func sendmsg(peerAddr *net.UDPAddr, conn *net.UDPConn, wg *sync.WaitGroup) { + defer wg.Done() + scanner := bufio.NewScanner(os.Stdin) + for { + fmt.Printf("Please enter your message: ") + if !scanner.Scan() { + break + } + + message := strings.TrimSpace(scanner.Text()) + + if message != "" { + _, err := conn.WriteToUDP([]byte(message), peerAddr) + if err != nil { + fmt.Printf("Error sending message: %v\n", err) + } else { + fmt.Printf("Sent: %s\n", message) + } + } + + time.Sleep(100 * time.Millisecond) + } +} + +func main() { + // Get local address + myAddr := &net.UDPAddr{ + Port: 1234, + IP: net.ParseIP("127.0.0.1"), + } + + // Create UDP listener + listener, err := net.ListenUDP("udp", myAddr) + if err != nil { + log.Fatalf("Failed to create UDP listener: %v", err) + } + + fmt.Printf("Listening on %s\n", myAddr.String()) + + // Get peer address + var ip, port string + fmt.Print("Enter peer's IP address: ") + fmt.Scan(&ip) + fmt.Print("Enter peer's port: ") + fmt.Scan(&port) + + peerAddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%s:%s", ip, port)) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Peer address: %s\n", peerAddr.String()) + + // Use WaitGroup to coordinate goroutines + var wg sync.WaitGroup + wg.Add(2) + + // Start listening and sending goroutines + go listenmsg(listener, &wg) + go sendmsg(peerAddr, listener, &wg) + + // Wait for both goroutines to finish + wg.Wait() + fmt.Println("Program ended") + +} diff --git a/XS_proto/PostgreSQL/sql.go b/XS_proto/PostgreSQL/sql.go new file mode 100644 index 0000000..19aaa24 --- /dev/null +++ b/XS_proto/PostgreSQL/sql.go @@ -0,0 +1,79 @@ +package PostgreSQL + +import ( + "context" + "fmt" + "time" + + "github.com/jackc/pgx/v5/pgxpool" +) + +func ConnectDB(ctx context.Context, username string, pass string, db_name string) (*pgxpool.Pool, error) { + connStr := fmt.Sprintf("postgres://%s:%s@localhost:5432/%s?sslmode=disable&pool_max_conns=10", username, pass, db_name) + + config, err := pgxpool.ParseConfig(connStr) + if err != nil { + return nil, fmt.Errorf("failed to parse config: %w", err) + } + + pool, err := pgxpool.NewWithConfig(ctx, config) + if err != nil { + return nil, fmt.Errorf("failed to create connection pool: %w", err) + } + + // Test the connection + if err := pool.Ping(ctx); err != nil { + pool.Close() + return nil, fmt.Errorf("failed to ping database: %w", err) + } + + return pool, nil +} + +func CreateTableIfNotExists(ctx context.Context, pool *pgxpool.Pool, table string) error { + // Drop table if it exists to ensure clean schema + dropSQL := fmt.Sprintf(`DROP TABLE IF EXISTS %s`, table) + _, err := pool.Exec(ctx, dropSQL) + if err != nil { + return fmt.Errorf("failed to drop existing table: %w", err) + } + + // Create table with correct schema + sql := fmt.Sprintf(` + CREATE TABLE %s ( + id SERIAL PRIMARY KEY, + filename VARCHAR(255) NOT NULL, + filepath TEXT NOT NULL, + embedding FLOAT8[] NOT NULL, + d1tv_id INTEGER NOT NULL, + created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() + )`, table) + + _, err = pool.Exec(ctx, sql) + if err != nil { + return fmt.Errorf("failed to create table: %w", err) + } + + fmt.Printf("[INFO] Table '%s' created successfully\n", table) + return nil +} + +func AddData(ctx context.Context, pool *pgxpool.Pool, table string, filename string, filepath string, embedding []float64, d1tv_id int) error { + sql := fmt.Sprintf(`INSERT INTO %s (filename, filepath, embedding, d1tv_id, created_at) + VALUES ($1, $2, $3, $4, $5)`, table) + + ct, err := pool.Exec(ctx, sql, + filename, + filepath, + embedding, + d1tv_id, + time.Now(), + ) + + if err != nil { + return fmt.Errorf("database insert failed: %w", err) + } + + fmt.Printf("[DB INSERT SUCCESS] Rows affected: %d\n", ct.RowsAffected()) + return nil +} diff --git a/XS_proto/TV/TV.go b/XS_proto/TV/TV.go new file mode 100644 index 0000000..832a6d6 --- /dev/null +++ b/XS_proto/TV/TV.go @@ -0,0 +1,29 @@ +package TV + +import ( + "math/rand" + "sync" + "time" +) + +var ( + once sync.Once + globalRand *rand.Rand +) + +func initRand() { + globalRand = rand.New(rand.NewSource(time.Now().UnixNano())) +} + +func Generatetaggingvectors() [][]int { + once.Do(initRand) + + taggingVectors := make([][]int, 10) + for j := 0; j < 10; j++ { + taggingVectors[j] = make([]int, 128) + for i := 0; i < 128; i++ { + taggingVectors[j][i] = globalRand.Intn(2) + } + } + return taggingVectors +} diff --git a/XS_proto/TestFolder/a.txt b/XS_proto/TestFolder/a.txt new file mode 100644 index 0000000..c097a74 --- /dev/null +++ b/XS_proto/TestFolder/a.txt @@ -0,0 +1 @@ +Good Morning \ No newline at end of file diff --git a/XS_proto/TestFolder/b.txt b/XS_proto/TestFolder/b.txt new file mode 100644 index 0000000..46018c5 --- /dev/null +++ b/XS_proto/TestFolder/b.txt @@ -0,0 +1 @@ +Bonjour \ No newline at end of file diff --git a/XS_proto/TestFolder/c.txt b/XS_proto/TestFolder/c.txt new file mode 100644 index 0000000..a8fc612 --- /dev/null +++ b/XS_proto/TestFolder/c.txt @@ -0,0 +1 @@ +Guten Tag \ No newline at end of file diff --git a/XS_proto/TestFolder/d.txt b/XS_proto/TestFolder/d.txt new file mode 100644 index 0000000..af5a062 --- /dev/null +++ b/XS_proto/TestFolder/d.txt @@ -0,0 +1 @@ +Hola \ No newline at end of file diff --git a/XS_proto/TestFolder/e.txt b/XS_proto/TestFolder/e.txt new file mode 100644 index 0000000..b8a06f4 --- /dev/null +++ b/XS_proto/TestFolder/e.txt @@ -0,0 +1 @@ +Bom Dia \ No newline at end of file diff --git a/XS_proto/TestFolder/f.txt b/XS_proto/TestFolder/f.txt new file mode 100644 index 0000000..50b139b --- /dev/null +++ b/XS_proto/TestFolder/f.txt @@ -0,0 +1 @@ +Ran out of languages \ No newline at end of file diff --git a/XS_proto/go.mod b/XS_proto/go.mod new file mode 100644 index 0000000..12f1979 --- /dev/null +++ b/XS_proto/go.mod @@ -0,0 +1,14 @@ +module XSproto + +go 1.24.4 + + +require ( + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect + github.com/jackc/puddle/v2 v2.2.2 // indirect + golang.org/x/crypto v0.37.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/text v0.24.0 // indirect + github.com/jackc/pgx/v5 v5.7.5 +) diff --git a/XS_proto/go.sum b/XS_proto/go.sum new file mode 100644 index 0000000..85a678b --- /dev/null +++ b/XS_proto/go.sum @@ -0,0 +1,28 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.7.5 h1:JHGfMnQY+IEtGM63d+NGMjoRpysB2JBwDr5fsngwmJs= +github.com/jackc/pgx/v5 v5.7.5/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/XS_proto/logs.txt b/XS_proto/logs.txt new file mode 100644 index 0000000..16feecb --- /dev/null +++ b/XS_proto/logs.txt @@ -0,0 +1,12 @@ +[Worker-1] Processed file: TestFolder\a.txt → D1TV: 1 (similarity: 0.688115) +[Worker-2] Processed file: TestFolder\c.txt → D1TV: 4 (similarity: 0.650465) +[Worker-4] Processed file: TestFolder\d.txt → D1TV: 5 (similarity: 0.620840) +[Worker-3] Processed file: TestFolder\b.txt → D1TV: 7 (similarity: 0.684859) +[Worker-1] Processed file: TestFolder\f.txt → D1TV: 6 (similarity: 0.704229) +[Worker-5] Processed file: TestFolder\e.txt → D1TV: 4 (similarity: 0.650721) +[Worker-5] Processed file: TestFolder\e.txt → D1TV: 0 (similarity: 0.662181) +[Worker-5] Processed file: TestFolder\f.txt → D1TV: 6 (similarity: 0.662959) +[Worker-3] Processed file: TestFolder\c.txt → D1TV: 0 (similarity: 0.661798) +[Worker-2] Processed file: TestFolder\b.txt → D1TV: 1 (similarity: 0.648956) +[Worker-1] Processed file: TestFolder\a.txt → D1TV: 3 (similarity: 0.629464) +[Worker-4] Processed file: TestFolder\d.txt → D1TV: 1 (similarity: 0.655854) diff --git a/XS_proto/main.go b/XS_proto/main.go new file mode 100644 index 0000000..33b32da --- /dev/null +++ b/XS_proto/main.go @@ -0,0 +1,188 @@ +package main + +import ( + "XSproto/TV" + "XSproto/PostgreSQL" + "context" + "fmt" + "io/fs" + "log" + "math" + "math/rand" + "os" + "os/signal" + "path/filepath" + "strings" + "sync" + "syscall" + "time" + + "github.com/jackc/pgx/v5/pgxpool" +) + + +func generate_sample_embedding(content string, n int) []float64 { + embedding := make([]float64, 0, n) + source := rand.NewSource(time.Now().UnixNano()) + r := rand.New(source) + for i := 0; i < n; i++ { + embedding = append(embedding, r.Float64()) + } + return embedding +} + +func cosineSimilarity(a, b []float64) float64 { + if len(a) != len(b) { + log.Printf("Vector lengths do not match: %d vs %d", len(a), len(b)) + return 0 + } + var dotProduct, normA, normB float64 + for i := range a { + dotProduct += a[i] * b[i] + normA += a[i] * a[i] + normB += b[i] * b[i] + } + if normA == 0 || normB == 0 { + return 0 + } + return dotProduct / (math.Sqrt(normA) * math.Sqrt(normB)) +} + +func logging(data string) { + f, err := os.OpenFile("logs.txt", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644) + if err != nil { + log.Printf("Failed to open log file: %v", err) + return + } + defer f.Close() + + _, err = f.Write([]byte(data + "\n")) + if err != nil { + log.Printf("Failed to write to log file: %v", err) + } +} + +func worker(ctx context.Context, id int, filejobs <-chan string, pool *pgxpool.Pool, table string, wg *sync.WaitGroup) { + defer wg.Done() + + for { + select { + case <-ctx.Done(): + fmt.Printf("[Worker-%d] Context cancelled, exiting...\n", id) + return + case j, ok := <-filejobs: + if !ok { + fmt.Printf("[Worker-%d] Job channel closed, exiting...\n", id) + return + } + + data, err := os.ReadFile(j) + if err != nil { + fmt.Printf("[Worker-%d] Read error: %v\n", id, err) + continue + } + Data := string(data) + + taggingVectors := TV.Generatetaggingvectors() + embedding := generate_sample_embedding(Data, 128) + + var maxIndex int + var maxSim float64 = -1 + + for i, tagVec := range taggingVectors { + tagVecFloat := make([]float64, len(tagVec)) + for k, v := range tagVec { + tagVecFloat[k] = float64(v) + } + sim := cosineSimilarity(embedding, tagVecFloat) + if sim > maxSim { + maxSim = sim + maxIndex = i + } + } + + parts := strings.Split(j, string(filepath.Separator)) + filename := parts[len(parts)-1] + + fileCtx, cancel := context.WithTimeout(ctx, 10*time.Second) + new_err := PostgreSQL.AddData(fileCtx, pool, table, filename, j, embedding, maxIndex) + cancel() + + if new_err != nil { + fmt.Printf("[ERROR] Failed to insert %s: %v\n", filename, new_err) + } else { + fmt.Printf("[INFO] Inserted %s successfully.\n", filename) + } + + logMsg := fmt.Sprintf("[Worker-%d] Processed file: %s → D1TV: %d (similarity: %f)", id, j, maxIndex, maxSim) + logging(logMsg) + } + } +} + +func Assignjobs(filejobs chan<- string, root string) { + defer close(filejobs) + + err := filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error { + if err != nil { + fmt.Printf("Error accessing path %q: %v\n", path, err) + return err + } + if !d.IsDir() { + filejobs <- path + } + return nil + }) + + if err != nil { + fmt.Printf("Error walking the directory: %v\n", err) + } +} + +func main() { + buffer_size := 10 + root := "./TestFolder" + jobs := make(chan string, buffer_size) + var username string = "postgres" + var pass string = "Ishat@123" + var db_name string = "mydb" + var table_name string = "filenest" + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + c := make(chan os.Signal, 1) + signal.Notify(c, os.Interrupt, syscall.SIGTERM) + + go func() { + <-c + fmt.Println("\n[INFO] Shutdown signal received, shutting down gracefully...") + cancel() + }() + + // Use connection pool instead of single connection + pool, err := PostgreSQL.ConnectDB(ctx, username, pass, db_name) + if err != nil { + log.Fatal(err) + } + defer pool.Close() + + // Create/recreate table with correct schema + err = PostgreSQL.CreateTableIfNotExists(ctx, pool, table_name) + if err != nil { + log.Fatal(err) + } + + var wg sync.WaitGroup + numWorkers := 5 + + for w := 1; w <= numWorkers; w++ { + wg.Add(1) + go worker(ctx, w, jobs, pool, table_name, &wg) + } + + go Assignjobs(jobs, root) + + wg.Wait() + fmt.Println("[INFO] All workers finished, shutting down...") +} diff --git a/crud/README.md b/crud/README.md new file mode 100644 index 0000000..004e234 --- /dev/null +++ b/crud/README.md @@ -0,0 +1,164 @@ +📁 FileNest CRUD API (Go + MongoDB) +A simple RESTful API built with Go, MongoDB, and Gorilla Mux, designed to perform Create, Read, Update, and Delete operations on file metadata records. + +🚀 Features +🌐 RESTful API endpoints + +📦 MongoDB Atlas integration + +🧩 Modular project structure + +✅ Input parsing and JSON serialization + +🧪 Clean separation of concerns (controller, router, model) + +📁 Project Structure +python +Copy +Edit +FileNest/ +├── crud/ +│ ├── controller/ # Business logic and DB operations +│ │ └── controller.go +│ ├── model/ # Data models +│ │ └── model.go +│ ├── router/ # API route definitions +│ │ └── router.go +│ ├── main.go # App entry point +│ ├── go.mod # Go module definition +│ └── go.sum # Go dependencies lock file +🛠 Technologies Used +Go (1.20+) + +MongoDB Atlas (Cloud MongoDB) + +Gorilla Mux (HTTP Router) + +MongoDB Go Driver v2 + +📦 Data Model +The API handles metadata for files using the following model: + +go +Copy +Edit +type FileMetadata struct { + ID int `json:"id"` + FileName string `json:"filename"` + FilePath string `json:"filepath"` + FileSize int64 `json:"filesize"` + ContentType string `json:"content_type"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` +} +🔨 Implementation +1. Model Layer (model.go) +Defines the FileMetadata struct, which represents each file's metadata, including ID, filename, size, and timestamps. The struct is tagged with json and db tags for seamless encoding and MongoDB mapping. + +2. Controller Layer (controller.go) +Handles: + +Database connection via mongo.Connect() using the Go MongoDB Driver + +CRUD logic: + +createRecord() – Inserts a new document + +getallRecords() – Retrieves all documents + +getsingleRecord() – Fetches a specific document by id + +updateRecord() – Updates fields like FilePath, FileSize, UpdatedAt + +deleteRecord() – Deletes a document by id + +HTTP handlers (CreateRecord, GetAllRecords, etc.) use Gorilla Mux to parse request parameters and body. + +3. Router Layer (router.go) +Maps HTTP endpoints to corresponding controller functions using the Gorilla Mux router: + +GET /api/files → Get all records + +GET /api/files/{id} → Get a single record + +POST /api/files → Create a record + +PUT /api/files/{id} → Update a record + +DELETE /api/files/{id} → Delete a record + +4. Entry Point (main.go) +Bootstraps the application: + +Calls the Router() function to set up routes + +Starts the HTTP server on port 4000 + +🔗 API Endpoints +Method Endpoint Description +GET /api/files Get all file records +GET /api/files/{id} Get a single file record +POST /api/files Create a new record +PUT /api/files/{id} Update a file record +DELETE /api/files/{id} Delete a file record + +🧪 Sample Payload (POST/PUT) +json +Copy +Edit +{ + "id": 1, + "filename": "example.pdf", + "filepath": "/documents/example.pdf", + "filesize": 2048, + "content_type": "application/pdf", + "created_at": "2025-06-26T10:00:00Z", + "updated_at": "2025-06-26T10:00:00Z" +} +⚙️ Setup Instructions +1. Clone the Repository +bash +Copy +Edit +git clone https://github.com/IshatV412/FileNest.git +cd FileNest/crud +2. Configure MongoDB +Update the connectionString in controller.go with your MongoDB Atlas URI: + +go +Copy +Edit +const connectionString = "your-mongodb-uri" +3. Initialize Go Modules +bash +Copy +Edit +go mod tidy +4. Run the Server +bash +Copy +Edit +go run main.go + +POSTMAN SS +![alt text](image.png) +![alt text](image-1.png) +![alt text](image-2.png) +![alt text](image-3.png) +![alt text](image-4.png) + +🧼 Notes +All API responses are in JSON. + +Assumes MongoDB documents are indexed by id: int. + +Includes CORS method headers for POST/PUT/DELETE support. + +This version is local-dev friendly and does not use Docker or production hardening. + +🙋‍♀️ Contributing +Pull requests are welcome. Please ensure code is tested and documented. + +📝 License +MIT License © 2025 Ishat Varshney + diff --git a/crud/controller/controller.go b/crud/controller/controller.go new file mode 100644 index 0000000..f218af3 --- /dev/null +++ b/crud/controller/controller.go @@ -0,0 +1,206 @@ +package controller + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "log" + "net/http" + "strconv" + "strings" + "time" + + "file-nest-crud/model" + "github.com/gorilla/mux" + "go.mongodb.org/mongo-driver/v2/bson" + "go.mongodb.org/mongo-driver/v2/mongo" + "go.mongodb.org/mongo-driver/v2/mongo/options" +) + +const connectionString = "mongodb+srv://ishatvarshney:Kg438PRRVxc6vg5@cluster0.rygxhix.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0" +const dbName = "FileNest" +const colName = "Task1" + +var collection *mongo.Collection + +func init() { + client, err := mongo.Connect(options.Client().ApplyURI(connectionString)) + if err != nil { + log.Fatal(err) + } + + err = client.Ping(context.Background(), nil) + if err != nil { + log.Fatal("MongoDB ping failed:", err) + } + + fmt.Println("MongoDB connected successfully") + collection = client.Database(dbName).Collection(colName) + fmt.Println("Collection instance is ready") +} + +func validateRecord(record model.FileMetadata) error { + if strings.TrimSpace(record.FileName) == "" { + return errors.New("file name is required") + } + if strings.TrimSpace(record.FilePath) == "" { + return errors.New("file path is required") + } + if record.FileSize <= 0 { + return errors.New("file size must be greater than zero") + } + if strings.TrimSpace(record.ContentType) == "" { + return errors.New("content type is required") + } + return nil +} + +func createRecord(record model.FileMetadata) { + inserted, err := collection.InsertOne(context.Background(), record) + if err != nil { + log.Fatal(err) + } + fmt.Println("Inserted a record with id:", inserted.InsertedID) +} + +func updateRecord(ID int, updatedData model.FileMetadata) { + filter := bson.M{"id": ID} + update := bson.M{ + "$set": bson.M{ + "filepath": updatedData.FilePath, + "filesize": updatedData.FileSize, + "content_type": updatedData.ContentType, + "updated_at": time.Now(), + }, + } + result, err := collection.UpdateOne(context.Background(), filter, update) + if err != nil { + log.Fatal(err) + } + fmt.Println("Modified count:", result.ModifiedCount) +} + +func deleteRecord(ID int) { + filter := bson.M{"id": ID} + result, err := collection.DeleteOne(context.Background(), filter) + if err != nil { + log.Fatal(err) + } + fmt.Println("Record was deleted with count:", result.DeletedCount) +} + +func getallRecords() []bson.M { + cur, err := collection.Find(context.Background(), bson.D{{}}) + if err != nil { + log.Fatal(err) + } + + var records []bson.M + for cur.Next(context.Background()) { + var record bson.M + err := cur.Decode(&record) + if err != nil { + log.Fatal(err) + } + records = append(records, record) + } + defer cur.Close(context.Background()) + return records +} + +func getsingleRecord(ID int) bson.M { + filter := bson.M{"id": ID} + var record bson.M + err := collection.FindOne(context.Background(), filter).Decode(&record) + if err != nil { + log.Println("Error finding record:", err) + return bson.M{"error": "Record not found"} + } + return record +} + +func GetAllRecords(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + allrecords := getallRecords() + json.NewEncoder(w).Encode(allrecords) +} + +func GetSingleRecord(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + params := mux.Vars(r) + ID, err := strconv.Atoi(params["id"]) + if err != nil { + http.Error(w, "Invalid ID", http.StatusBadRequest) + return + } + singlerecord := getsingleRecord(ID) + json.NewEncoder(w).Encode(singlerecord) +} + +func CreateRecord(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Header().Set("Access-Control-Allow-Methods", "POST") + + var record model.FileMetadata + err := json.NewDecoder(r.Body).Decode(&record) + if err != nil { + http.Error(w, "Invalid JSON", http.StatusBadRequest) + return + } + + err = validateRecord(record) + if err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + record.CreatedAt = time.Now() + record.UpdatedAt = time.Now() + + createRecord(record) + json.NewEncoder(w).Encode(record) +} + +func UpdateRecord(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Header().Set("Access-Control-Allow-Methods", "PUT") + + params := mux.Vars(r) + id, err := strconv.Atoi(params["id"]) + if err != nil { + http.Error(w, "Invalid ID", http.StatusBadRequest) + return + } + + var record model.FileMetadata + err = json.NewDecoder(r.Body).Decode(&record) + if err != nil { + http.Error(w, "Invalid JSON", http.StatusBadRequest) + return + } + + err = validateRecord(record) + if err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + record.UpdatedAt = time.Now() + updateRecord(id, record) + json.NewEncoder(w).Encode(record) +} + +func DeleteRecord(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Header().Set("Access-Control-Allow-Methods", "DELETE") + + params := mux.Vars(r) + id, err := strconv.Atoi(params["id"]) + if err != nil { + http.Error(w, "Invalid ID", http.StatusBadRequest) + return + } + deleteRecord(id) + json.NewEncoder(w).Encode(bson.M{"deleted": id}) +} diff --git a/crud/go.mod b/crud/go.mod new file mode 100644 index 0000000..76295bd --- /dev/null +++ b/crud/go.mod @@ -0,0 +1,20 @@ +module file-nest-crud + +go 1.24.4 + +require ( + github.com/gorilla/mux v1.8.1 + go.mongodb.org/mongo-driver/v2 v2.2.2 +) + +require ( + github.com/golang/snappy v1.0.0 // indirect + github.com/klauspost/compress v1.16.7 // indirect + github.com/xdg-go/pbkdf2 v1.0.0 // indirect + github.com/xdg-go/scram v1.1.2 // indirect + github.com/xdg-go/stringprep v1.0.4 // indirect + github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect + golang.org/x/crypto v0.33.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/text v0.22.0 // indirect +) diff --git a/crud/go.sum b/crud/go.sum new file mode 100644 index 0000000..03209e3 --- /dev/null +++ b/crud/go.sum @@ -0,0 +1,50 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs= +github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= +github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM= +github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.mongodb.org/mongo-driver/v2 v2.2.2 h1:9cYuS3fl1Xhqwpfazso10V7BHQD58kCgtzhfAmJYz9c= +go.mongodb.org/mongo-driver/v2 v2.2.2/go.mod h1:qQkDMhCGWl3FN509DfdPd4GRBLU/41zqF/k8eTRceps= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/crud/image-1.png b/crud/image-1.png new file mode 100644 index 0000000..ec7c6e8 Binary files /dev/null and b/crud/image-1.png differ diff --git a/crud/image-2.png b/crud/image-2.png new file mode 100644 index 0000000..c3f67ec Binary files /dev/null and b/crud/image-2.png differ diff --git a/crud/image-3.png b/crud/image-3.png new file mode 100644 index 0000000..da09982 Binary files /dev/null and b/crud/image-3.png differ diff --git a/crud/image-4.png b/crud/image-4.png new file mode 100644 index 0000000..c7b9ce3 Binary files /dev/null and b/crud/image-4.png differ diff --git a/crud/image.png b/crud/image.png new file mode 100644 index 0000000..35ff681 Binary files /dev/null and b/crud/image.png differ diff --git a/crud/main.go b/crud/main.go new file mode 100644 index 0000000..2304286 --- /dev/null +++ b/crud/main.go @@ -0,0 +1,16 @@ +package main + +import ( + "fmt" + "log" + "net/http" + + "file-nest-crud/router" +) + +func main() { + r := router.Router() + fmt.Println("Server is getting started...") + log.Fatal(http.ListenAndServe(":4000", r)) + fmt.Println("Listening at port 4000...") +} diff --git a/crud/model/models.go b/crud/model/models.go new file mode 100644 index 0000000..06a224e --- /dev/null +++ b/crud/model/models.go @@ -0,0 +1,15 @@ +package model + +import ( + "time" +) + +type FileMetadata struct { + ID int `json:"id" db:"id"` + FileName string `json:"filename" db:"filename"` + FilePath string `json:"filepath" db:"filepath"` + FileSize int64 `json:"filesize" db:"filesize"` + ContentType string `json:"content_type" db:"content_type"` + CreatedAt time.Time `json:"created_at" db:"created_at"` + UpdatedAt time.Time `json:"updated_at" db:"updated_at"` +} diff --git a/crud/router/router.go b/crud/router/router.go new file mode 100644 index 0000000..503c6e0 --- /dev/null +++ b/crud/router/router.go @@ -0,0 +1,18 @@ +package router + +import ( + "file-nest-crud/controller" + "github.com/gorilla/mux" +) + +func Router() *mux.Router { + router := mux.NewRouter() + + router.HandleFunc("/api/files", controller.GetAllRecords).Methods("GET") + router.HandleFunc("/api/files/{id}", controller.GetSingleRecord).Methods("GET") + router.HandleFunc("/api/files", controller.CreateRecord).Methods("POST") + router.HandleFunc("/api/files/{id}", controller.UpdateRecord).Methods("PUT") + router.HandleFunc("/api/files/{id}", controller.DeleteRecord).Methods("DELETE") + + return router +} diff --git a/ml_task/README.md b/ml_task/README.md new file mode 100644 index 0000000..9e6ecf9 --- /dev/null +++ b/ml_task/README.md @@ -0,0 +1,234 @@ +MNIST MiniMobileNet with Hyperparameter Optimization +A lightweight MobileNet-inspired CNN for MNIST digit classification with automated hyperparameter tuning using Ray Tune and experiment tracking with Weights & Biases. + +🎯 Objective +Achieve 98.5%+ accuracy on MNIST dataset with less than 10,000 parameters using an optimized MobileNet architecture. + +🏗️ Architecture +OptimizedMiniMobileNet +Parameter Count: ~8,500-9,500 parameters (under 10k constraint) + +Architecture: Depthwise separable convolutions with batch normalization + +Layers: + +Initial convolution: 1→12 channels + +Depthwise separable block 1: 12→24 channels + +Depthwise separable block 2: 24→32 channels (stride=2) + +Depthwise separable block 3: 32→24 channels (stride=2) + +Global average pooling + dropout + linear classifier + +Key Features +Depthwise Separable Convolutions: Efficient parameter usage + +Batch Normalization: Training stability and faster convergence + +Strategic Downsampling: Spatial reduction with stride=2 + +Kaiming Weight Initialization: Improved training dynamics + +Dropout Regularization: Prevents overfitting + +🚀 Features +Automated Hyperparameter Optimization with Ray Tune + +Experiment Tracking with Weights & Biases + +Configuration Management with Hydra + +Data Augmentation (rotation, translation) + +Learning Rate Scheduling (StepLR) + +GPU Acceleration support + +📋 Requirements +bash +pip install torch torchvision +pip install ray[tune] +pip install wandb +pip install hydra-core omegaconf +pip install pandas +📁 Project Structure +text +. +├── train.py # Main training script +├── config.yaml # Hydra configuration file +├── README.md # This file +└── dataset/ # MNIST data (auto-downloaded) +⚙️ Configuration +Create a config.yaml file: + +text +model: + num_classes: 10 + dropout: 0.3 + +training: + num_epochs: 20 + +data: + root: "dataset/" + batch_sizes: [32, 64, 128] + +augmentation: + rotation_degrees: 10 + translate: [0.1, 0.1] + normalize_mean: [0.1307] + normalize_std: [0.3081] + +hyperparameter_search: + lr_min: 1e-4 + lr_max: 1e-2 + num_samples: 5 + metric: "mean_accuracy" + mode: "max" + +wandb: + project: "mnist-minimobilenet" + +ray_tune: + scheduler: + step_size: 7 + gamma: 0.1 +🏃‍♂️ Usage +Basic Training +bash +python train.py +Override Configuration Parameters +bash +# Change number of epochs +python train.py training.num_epochs=30 + +# Modify dropout rate +python train.py model.dropout=0.5 + +# Change number of Ray Tune samples +python train.py hyperparameter_search.num_samples=10 + +# Multiple overrides +python train.py training.num_epochs=50 model.dropout=0.2 hyperparameter_search.num_samples=8 +Custom Configuration File +bash +python train.py --config-name=custom_config +🔧 Hyperparameter Search +The system automatically optimizes: + +Learning Rate: Log-uniform distribution (1e-4 to 1e-2) + +Batch Size: Choice of + +Fixed Epochs: 20 (configurable) + +Uses ASHA Scheduler for efficient resource allocation and early stopping of poor-performing trials. + +📊 Experiment Tracking +Weights & Biases Integration +Real-time loss and accuracy tracking + +Hyperparameter comparison + +Model performance visualization + +Automatic experiment logging + +Metrics Logged +Training loss per batch + +Validation accuracy per epoch + +Hyperparameter configurations + +Model architecture details + +🎯 Performance Optimizations +Data Augmentation +Random Rotation: ±10 degrees + +Random Translation: ±10% in both directions + +Normalization: MNIST-specific statistics + +Training Enhancements +Learning Rate Scheduling: StepLR with decay + +Proper Weight Initialization: Kaiming initialization + +Batch Normalization: After each convolution + +Test Set Validation: Accurate performance measurement + +📈 Expected Results +Target Accuracy: 98.5%+ + +Parameter Count: <10,000 + +Training Time: ~5-10 minutes on GPU + +Convergence: Typically within 15-20 epochs + +🐛 Troubleshooting +Common Issues +Missing config.yaml + +text +MissingConfigException: Cannot find primary config 'config' +Solution: Create the config.yaml file in the project directory + +CUDA Out of Memory + +text +RuntimeError: CUDA out of memory +Solution: Reduce batch size in configuration + +Ray Tune Import Error + +text +ModuleNotFoundError: No module named 'ray' +Solution: Install Ray with pip install ray[tune] + +Wandb Authentication + +text +wandb: ERROR Unable to authenticate +Solution: Run wandb login and enter your API key + +🔬 Architecture Details +Parameter Distribution +Depthwise Convolutions: ~300 parameters + +Pointwise Convolutions: ~7,500 parameters + +Batch Normalization: ~200 parameters + +Final Classifier: ~250 parameters + +Total: ~8,250 parameters + +Design Principles +Efficiency: Depthwise separable convolutions reduce parameters by 8-9x + +Stability: Batch normalization enables faster, more stable training + +Regularization: Dropout and data augmentation prevent overfitting + +Scalability: Modular design allows easy architecture modifications + +📝 License +This project is open source and available under the MIT License. + +🤝 Contributing +Contributions are welcome! Please feel free to submit a Pull Request. + +📚 References +MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications + +Ray Tune Documentation + +Hydra Configuration Framework + +Weights & Biases \ No newline at end of file diff --git a/ml_task/config.yaml b/ml_task/config.yaml new file mode 100644 index 0000000..3cc9b31 --- /dev/null +++ b/ml_task/config.yaml @@ -0,0 +1,33 @@ +# config.yaml +model: + num_classes: 10 + dropout: 0.3 + +training: + num_epochs: 20 + device: "cuda" + +data: + root: "dataset/" + batch_sizes: [32, 64, 128] + +augmentation: + rotation_degrees: 10 + translate: [0.1, 0.1] + normalize_mean: [0.1307] + normalize_std: [0.3081] + +hyperparameter_search: + lr_min: 1e-4 + lr_max: 1e-2 + num_samples: 5 + metric: "mean_accuracy" + mode: "max" + +wandb: + project: "mnist-minimobilenet" + +ray_tune: + scheduler: + step_size: 7 + gamma: 0.1 diff --git a/ml_task/dataset/MNIST/raw/t10k-images-idx3-ubyte b/ml_task/dataset/MNIST/raw/t10k-images-idx3-ubyte new file mode 100644 index 0000000..1170b2c Binary files /dev/null and b/ml_task/dataset/MNIST/raw/t10k-images-idx3-ubyte differ diff --git a/ml_task/dataset/MNIST/raw/t10k-labels-idx1-ubyte b/ml_task/dataset/MNIST/raw/t10k-labels-idx1-ubyte new file mode 100644 index 0000000..d1c3a97 Binary files /dev/null and b/ml_task/dataset/MNIST/raw/t10k-labels-idx1-ubyte differ diff --git a/ml_task/dataset/MNIST/raw/train-images-idx3-ubyte b/ml_task/dataset/MNIST/raw/train-images-idx3-ubyte new file mode 100644 index 0000000..bbce276 Binary files /dev/null and b/ml_task/dataset/MNIST/raw/train-images-idx3-ubyte differ diff --git a/ml_task/dataset/MNIST/raw/train-labels-idx1-ubyte b/ml_task/dataset/MNIST/raw/train-labels-idx1-ubyte new file mode 100644 index 0000000..d6b4c5d Binary files /dev/null and b/ml_task/dataset/MNIST/raw/train-labels-idx1-ubyte differ diff --git a/ml_task/ml_task_nn.py b/ml_task/ml_task_nn.py new file mode 100644 index 0000000..3c0f808 --- /dev/null +++ b/ml_task/ml_task_nn.py @@ -0,0 +1,232 @@ +import torch +import torch.nn as nn +import torch.optim as optim +from torch.utils.data import DataLoader +import torch.nn.functional as F +import torchvision.datasets as datasets +import torchvision.transforms as transforms +import wandb +from ray import tune +from ray.tune.schedulers import ASHAScheduler +from ray.air.integrations.wandb import WandbLoggerCallback +import hydra +from omegaconf import DictConfig, OmegaConf + +device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') + +# Initially i intended to build my own NN, but my architecture was able to yield 94% at best. +# Hence I took help from LLMs to construct this neural network. +class OptimizedMiniMobileNet(nn.Module): + def __init__(self, num_classes=10, dropout=0.3): + super(OptimizedMiniMobileNet, self).__init__() + + # Initial convolution + self.conv1 = nn.Conv2d(1, 12, kernel_size=3, stride=1, padding=1, bias=False) + self.bn1 = nn.BatchNorm2d(12) + + # First depthwise separable block + self.dw_conv1 = nn.Conv2d(12, 12, kernel_size=3, stride=1, padding=1, groups=12, bias=False) + self.bn_dw1 = nn.BatchNorm2d(12) + self.pw_conv1 = nn.Conv2d(12, 24, kernel_size=1, stride=1, padding=0, bias=False) + self.bn_pw1 = nn.BatchNorm2d(24) + + # Second depthwise separable block with stride + self.dw_conv2 = nn.Conv2d(24, 24, kernel_size=3, stride=2, padding=1, groups=24, bias=False) + self.bn_dw2 = nn.BatchNorm2d(24) + self.pw_conv2 = nn.Conv2d(24, 32, kernel_size=1, stride=1, padding=0, bias=False) + self.bn_pw2 = nn.BatchNorm2d(32) + + # Third depthwise separable block with stride + self.dw_conv3 = nn.Conv2d(32, 32, kernel_size=3, stride=2, padding=1, groups=32, bias=False) + self.bn_dw3 = nn.BatchNorm2d(32) + self.pw_conv3 = nn.Conv2d(32, 24, kernel_size=1, stride=1, padding=0, bias=False) + self.bn_pw3 = nn.BatchNorm2d(24) + + # Global average pooling and classifier + self.global_pool = nn.AdaptiveAvgPool2d((1, 1)) + self.dropout = nn.Dropout(dropout) + self.fc = nn.Linear(24, num_classes) + + # Initialize weights + self._initialize_weights() + + def _initialize_weights(self): + for m in self.modules(): + if isinstance(m, nn.Conv2d): + nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu') + elif isinstance(m, nn.BatchNorm2d): + nn.init.constant_(m.weight, 1) + nn.init.constant_(m.bias, 0) + elif isinstance(m, nn.Linear): + nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu') + nn.init.constant_(m.bias, 0) + + def forward(self, x): + # Initial convolution + x = F.relu(self.bn1(self.conv1(x))) + + # First depthwise separable block + x = F.relu(self.bn_dw1(self.dw_conv1(x))) + x = F.relu(self.bn_pw1(self.pw_conv1(x))) + + # Second depthwise separable block + x = F.relu(self.bn_dw2(self.dw_conv2(x))) + x = F.relu(self.bn_pw2(self.pw_conv2(x))) + + # Third depthwise separable block + x = F.relu(self.bn_dw3(self.dw_conv3(x))) + x = F.relu(self.bn_pw3(self.pw_conv3(x))) + + # Global pooling and classification + x = self.global_pool(x) + x = x.view(x.size(0), -1) + x = self.dropout(x) + x = self.fc(x) + + return x + +def count_parameters(model): + return sum(p.numel() for p in model.parameters() if p.requires_grad) + +def create_transforms(cfg): + """Create transforms based on config""" + # Training transforms with augmentation + transform_train = transforms.Compose([ + transforms.RandomRotation(cfg.augmentation.rotation_degrees), + transforms.RandomAffine(degrees=0, translate=tuple(cfg.augmentation.translate)), + transforms.ToTensor(), + transforms.Normalize(tuple(cfg.augmentation.normalize_mean), + tuple(cfg.augmentation.normalize_std)) + ]) + + # Test transforms without augmentation + transform_test = transforms.Compose([ + transforms.ToTensor(), + transforms.Normalize(tuple(cfg.augmentation.normalize_mean), + tuple(cfg.augmentation.normalize_std)) + ]) + + return transform_train, transform_test + +def train_mnist(config, cfg): + learning_rate = config["lr"] + batch_size = config["batch_size"] + num_epochs = cfg.training.num_epochs + + # Create transforms using config + transform_train, transform_test = create_transforms(cfg) + + train_dataset = datasets.MNIST(root=cfg.data.root, train=True, download=True, transform=transform_train) + test_dataset = datasets.MNIST(root=cfg.data.root, train=False, download=True, transform=transform_test) + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=True) + test_loader = DataLoader(dataset=test_dataset, batch_size=batch_size, shuffle=False) + + model = OptimizedMiniMobileNet( + num_classes=cfg.model.num_classes, + dropout=cfg.model.dropout + ).to(device) + + total_params = count_parameters(model) + print(f"Total trainable parameters: {total_params}") + assert total_params <= 10000, "Parameter count exceeds 10,000" + + criterion = nn.CrossEntropyLoss() + optimizer = optim.Adam(model.parameters(), lr=learning_rate) + + # Add learning rate scheduler using config + scheduler = optim.lr_scheduler.StepLR( + optimizer, + step_size=cfg.ray_tune.scheduler.step_size, + gamma=cfg.ray_tune.scheduler.gamma + ) + + def check_accuracy(loader, model): + num_correct = 0 + num_samples = 0 + model.eval() + with torch.no_grad(): + for x, y in loader: + x = x.to(device) + y = y.to(device) + scores = model(x) + _, predictions = scores.max(1) + num_correct += (predictions == y).sum().item() + num_samples += y.size(0) + val_acc = num_correct / num_samples + return val_acc + + for epoch in range(num_epochs): + model.train() + for batch_idx, (data, targets) in enumerate(train_loader): + data = data.to(device) + targets = targets.to(device) + scores = model(data) + loss = criterion(scores, targets) + optimizer.zero_grad() + loss.backward() + optimizer.step() + + # Step the scheduler + scheduler.step() + + # Use test_loader for validation accuracy + val_acc = check_accuracy(test_loader, model) + tune.report( + metrics={ + "mean_accuracy": val_acc, + "val_acc": val_acc, + "epoch": epoch, + "loss": loss.item() + } + ) + +@hydra.main(version_base=None, config_path=".", config_name="config") +def main(cfg: DictConfig): + print("Configuration:") + print(OmegaConf.to_yaml(cfg)) + + # Create parameter space using config + param_space = { + "lr": tune.loguniform(cfg.hyperparameter_search.lr_min, cfg.hyperparameter_search.lr_max), + "batch_size": tune.choice(cfg.data.batch_sizes), + } + + scheduler = ASHAScheduler( + metric=cfg.hyperparameter_search.metric, + mode=cfg.hyperparameter_search.mode + ) + + # Create a wrapper function that includes cfg + def train_with_config(config): + return train_mnist(config, cfg) + + tuner = tune.Tuner( + train_with_config, + param_space=param_space, + tune_config=tune.TuneConfig( + scheduler=scheduler, + num_samples=cfg.hyperparameter_search.num_samples + ), + run_config=tune.RunConfig( + callbacks=[ + WandbLoggerCallback( + project=cfg.wandb.project, + log_config=True + ) + ] + ) + ) + + results = tuner.fit() + + best_result = results.get_best_result( + metric=cfg.hyperparameter_search.metric, + mode=cfg.hyperparameter_search.mode + ) + df = best_result.metrics_dataframe + print("Best config:", best_result.config) + print("Accuracy: ", best_result.metrics) + +if __name__ == "__main__": + main() diff --git a/ml_task/pyproject.toml b/ml_task/pyproject.toml new file mode 100644 index 0000000..890b0bc --- /dev/null +++ b/ml_task/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "ml-task" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.12" +dependencies = [] diff --git a/ml_task/wandb/latest-run b/ml_task/wandb/latest-run new file mode 120000 index 0000000..1fa8b34 --- /dev/null +++ b/ml_task/wandb/latest-run @@ -0,0 +1 @@ +run-20250629_082713-l40xw0su \ No newline at end of file diff --git a/ml_task/wandb/run-20250628_195407-dws69jip/files/requirements.txt b/ml_task/wandb/run-20250628_195407-dws69jip/files/requirements.txt new file mode 100644 index 0000000..1124f7f --- /dev/null +++ b/ml_task/wandb/run-20250628_195407-dws69jip/files/requirements.txt @@ -0,0 +1,65 @@ +annotated-types==0.7.0 +antlr4-python3-runtime==4.9.3 +asttokens==3.0.0 +certifi==2025.6.15 +charset-normalizer==3.4.2 +click==8.2.1 +comm==0.2.2 +debugpy==1.8.14 +decorator==5.2.1 +executing==2.2.0 +filelock==3.18.0 +fsspec==2025.5.1 +gitdb==4.0.12 +GitPython==3.1.44 +hydra-core==1.3.2 +idna==3.10 +ipykernel==6.29.5 +ipython==9.3.0 +ipython_pygments_lexers==1.1.1 +jedi==0.19.2 +Jinja2==3.1.6 +jupyter_client==8.6.3 +jupyter_core==5.8.1 +MarkupSafe==2.1.5 +matplotlib-inline==0.1.7 +mpmath==1.3.0 +nest-asyncio==1.6.0 +networkx==3.5 +numpy==2.3.0 +omegaconf==2.3.0 +packaging==25.0 +parso==0.8.4 +pexpect==4.9.0 +pillow==11.2.1 +pip==24.0 +platformdirs==4.3.8 +prompt_toolkit==3.0.51 +protobuf==6.31.1 +psutil==7.0.0 +ptyprocess==0.7.0 +pure_eval==0.2.3 +pydantic==2.11.7 +pydantic_core==2.33.2 +Pygments==2.19.2 +python-dateutil==2.9.0.post0 +PyYAML==6.0.2 +pyzmq==27.0.0 +requests==2.32.4 +sentry-sdk==2.32.0 +setproctitle==1.3.6 +setuptools==78.1.0 +six==1.17.0 +smmap==5.0.2 +stack-data==0.6.3 +sympy==1.14.0 +torch==2.9.0.dev20250628+cpu +torchaudio==2.8.0.dev20250628+cpu +torchvision==0.23.0.dev20250628+cpu +tornado==6.5.1 +traitlets==5.14.3 +typing_extensions==4.14.0 +typing-inspection==0.4.1 +urllib3==2.5.0 +wandb==0.20.1 +wcwidth==0.2.13 diff --git a/ml_task/wandb/run-20250628_195407-dws69jip/files/wandb-metadata.json b/ml_task/wandb/run-20250628_195407-dws69jip/files/wandb-metadata.json new file mode 100644 index 0000000..5bddd50 --- /dev/null +++ b/ml_task/wandb/run-20250628_195407-dws69jip/files/wandb-metadata.json @@ -0,0 +1,31 @@ +{ + "os": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", + "python": "CPython 3.12.3", + "startedAt": "2025-06-28T19:54:10.141699Z", + "program": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/pytorch_sample_nn.ipynb", + "codePath": "ml_task/pytorch_sample_nn.ipynb", + "git": { + "remote": "git@github.com:IshatV412/FileNest.git", + "commit": "fcebb8e1e8250e16cb6cf1e6b5593c2bc96994ac" + }, + "email": "b24me1034@iitj.ac.in", + "root": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task", + "host": "DESKTOP-7NSUMT9", + "executable": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/mltask/bin/python", + "codePathLocal": "pytorch_sample_nn.ipynb", + "cpu_count": 4, + "cpu_count_logical": 8, + "disk": { + "/": { + "total": "1081101176832", + "used": "5890306048" + } + }, + "memory": { + "total": "3974320128" + }, + "cpu": { + "count": 4, + "countLogical": 8 + } +} \ No newline at end of file diff --git a/ml_task/wandb/run-20250628_195407-dws69jip/run-dws69jip.wandb b/ml_task/wandb/run-20250628_195407-dws69jip/run-dws69jip.wandb new file mode 100644 index 0000000..2207a8a Binary files /dev/null and b/ml_task/wandb/run-20250628_195407-dws69jip/run-dws69jip.wandb differ diff --git a/ml_task/wandb/run-20250629_052300-i2wagi0v/files/config.yaml b/ml_task/wandb/run-20250629_052300-i2wagi0v/files/config.yaml new file mode 100644 index 0000000..de354ea --- /dev/null +++ b/ml_task/wandb/run-20250629_052300-i2wagi0v/files/config.yaml @@ -0,0 +1,29 @@ +_wandb: + value: + cli_version: 0.20.1 + m: [] + python_version: 3.12.3 + t: + "1": + - 1 + - 30 + - 41 + - 50 + "2": + - 1 + - 30 + - 41 + - 50 + "3": + - 16 + - 55 + "4": 3.12.3 + "5": 0.20.1 + "12": 0.20.1 + "13": linux-x86_64 +batch_size: + value: 64 +epochs: + value: 20 +learning_rate: + value: 0.001 diff --git a/ml_task/wandb/run-20250629_052300-i2wagi0v/files/requirements.txt b/ml_task/wandb/run-20250629_052300-i2wagi0v/files/requirements.txt new file mode 100644 index 0000000..de7bc19 --- /dev/null +++ b/ml_task/wandb/run-20250629_052300-i2wagi0v/files/requirements.txt @@ -0,0 +1,102 @@ +colorama==0.4.6 +psutil==7.0.0 +setproctitle==1.2.2 +annotated-types==0.7.0 +antlr4-python3-runtime==4.9.3 +asttokens==3.0.0 +attrs==25.3.0 +certifi==2025.6.15 +charset-normalizer==3.4.2 +click==8.2.1 +cloudpickle==3.1.1 +comm==0.2.2 +debugpy==1.8.14 +decorator==5.2.1 +executing==2.2.0 +filelock==3.18.0 +fsspec==2025.5.1 +future==1.0.0 +gitdb==4.0.12 +GitPython==3.1.44 +hydra-core==1.3.2 +hyperopt==0.2.7 +idna==3.10 +ipykernel==6.29.5 +ipython==9.3.0 +ipython_pygments_lexers==1.1.1 +jedi==0.19.2 +Jinja2==3.1.6 +jsonschema==4.24.0 +jsonschema-specifications==2025.4.1 +jupyter_client==8.6.3 +jupyter_core==5.8.1 +MarkupSafe==2.1.5 +matplotlib-inline==0.1.7 +mpmath==1.3.0 +msgpack==1.1.1 +nest-asyncio==1.6.0 +networkx==3.5 +numpy==2.3.0 +omegaconf==2.3.0 +packaging==25.0 +pandas==2.3.0 +parso==0.8.4 +pexpect==4.9.0 +pillow==11.2.1 +pip==24.0 +platformdirs==4.3.8 +prompt_toolkit==3.0.51 +protobuf==6.31.1 +psutil==7.0.0 +ptyprocess==0.7.0 +pure_eval==0.2.3 +py4j==0.10.9.9 +pyarrow==20.0.0 +pydantic==2.11.7 +pydantic_core==2.33.2 +Pygments==2.19.2 +python-dateutil==2.9.0.post0 +pytz==2025.2 +PyYAML==6.0.2 +pyzmq==27.0.0 +ray==2.47.1 +referencing==0.36.2 +requests==2.32.4 +rpds-py==0.25.1 +scipy==1.16.0 +sentry-sdk==2.32.0 +setproctitle==1.3.6 +setuptools==78.1.0 +six==1.17.0 +smmap==5.0.2 +stack-data==0.6.3 +sympy==1.14.0 +tensorboardX==2.6.4 +torch==2.9.0.dev20250628+cpu +torchaudio==2.8.0.dev20250628+cpu +torchvision==0.23.0.dev20250628+cpu +tornado==6.5.1 +tqdm==4.67.1 +traitlets==5.14.3 +typing_extensions==4.14.0 +typing-inspection==0.4.1 +tzdata==2025.2 +urllib3==2.5.0 +wandb==0.20.1 +wcwidth==0.2.13 +autocommand==2.2.2 +backports.tarfile==1.2.0 +importlib_metadata==8.0.0 +inflect==7.3.1 +jaraco.collections==5.1.0 +jaraco.context==5.3.0 +jaraco.functools==4.0.1 +jaraco.text==3.12.1 +more-itertools==10.3.0 +packaging==24.2 +platformdirs==4.2.2 +tomli==2.0.1 +typeguard==4.3.0 +typing_extensions==4.12.2 +wheel==0.45.1 +zipp==3.19.2 diff --git a/ml_task/wandb/run-20250629_052300-i2wagi0v/files/wandb-metadata.json b/ml_task/wandb/run-20250629_052300-i2wagi0v/files/wandb-metadata.json new file mode 100644 index 0000000..99390e1 --- /dev/null +++ b/ml_task/wandb/run-20250629_052300-i2wagi0v/files/wandb-metadata.json @@ -0,0 +1,31 @@ +{ + "os": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", + "python": "CPython 3.12.3", + "startedAt": "2025-06-29T05:23:01.730960Z", + "program": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/ml_task_nn.py", + "codePath": "ml_task/ml_task_nn.py", + "git": { + "remote": "git@github.com:IshatV412/FileNest.git", + "commit": "fcebb8e1e8250e16cb6cf1e6b5593c2bc96994ac" + }, + "email": "b24me1034@iitj.ac.in", + "root": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task", + "host": "DESKTOP-7NSUMT9", + "executable": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/mltask/bin/python", + "codePathLocal": "ml_task_nn.py", + "cpu_count": 4, + "cpu_count_logical": 8, + "disk": { + "/": { + "total": "1081101176832", + "used": "6400540672" + } + }, + "memory": { + "total": "3974320128" + }, + "cpu": { + "count": 4, + "countLogical": 8 + } +} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_052300-i2wagi0v/files/wandb-summary.json b/ml_task/wandb/run-20250629_052300-i2wagi0v/files/wandb-summary.json new file mode 100644 index 0000000..c059977 --- /dev/null +++ b/ml_task/wandb/run-20250629_052300-i2wagi0v/files/wandb-summary.json @@ -0,0 +1 @@ +{"_wandb":{"runtime":4}} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_052300-i2wagi0v/run-i2wagi0v.wandb b/ml_task/wandb/run-20250629_052300-i2wagi0v/run-i2wagi0v.wandb new file mode 100644 index 0000000..ca47670 Binary files /dev/null and b/ml_task/wandb/run-20250629_052300-i2wagi0v/run-i2wagi0v.wandb differ diff --git a/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/config.yaml b/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/config.yaml new file mode 100644 index 0000000..de354ea --- /dev/null +++ b/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/config.yaml @@ -0,0 +1,29 @@ +_wandb: + value: + cli_version: 0.20.1 + m: [] + python_version: 3.12.3 + t: + "1": + - 1 + - 30 + - 41 + - 50 + "2": + - 1 + - 30 + - 41 + - 50 + "3": + - 16 + - 55 + "4": 3.12.3 + "5": 0.20.1 + "12": 0.20.1 + "13": linux-x86_64 +batch_size: + value: 64 +epochs: + value: 20 +learning_rate: + value: 0.001 diff --git a/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/requirements.txt b/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/requirements.txt new file mode 100644 index 0000000..de7bc19 --- /dev/null +++ b/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/requirements.txt @@ -0,0 +1,102 @@ +colorama==0.4.6 +psutil==7.0.0 +setproctitle==1.2.2 +annotated-types==0.7.0 +antlr4-python3-runtime==4.9.3 +asttokens==3.0.0 +attrs==25.3.0 +certifi==2025.6.15 +charset-normalizer==3.4.2 +click==8.2.1 +cloudpickle==3.1.1 +comm==0.2.2 +debugpy==1.8.14 +decorator==5.2.1 +executing==2.2.0 +filelock==3.18.0 +fsspec==2025.5.1 +future==1.0.0 +gitdb==4.0.12 +GitPython==3.1.44 +hydra-core==1.3.2 +hyperopt==0.2.7 +idna==3.10 +ipykernel==6.29.5 +ipython==9.3.0 +ipython_pygments_lexers==1.1.1 +jedi==0.19.2 +Jinja2==3.1.6 +jsonschema==4.24.0 +jsonschema-specifications==2025.4.1 +jupyter_client==8.6.3 +jupyter_core==5.8.1 +MarkupSafe==2.1.5 +matplotlib-inline==0.1.7 +mpmath==1.3.0 +msgpack==1.1.1 +nest-asyncio==1.6.0 +networkx==3.5 +numpy==2.3.0 +omegaconf==2.3.0 +packaging==25.0 +pandas==2.3.0 +parso==0.8.4 +pexpect==4.9.0 +pillow==11.2.1 +pip==24.0 +platformdirs==4.3.8 +prompt_toolkit==3.0.51 +protobuf==6.31.1 +psutil==7.0.0 +ptyprocess==0.7.0 +pure_eval==0.2.3 +py4j==0.10.9.9 +pyarrow==20.0.0 +pydantic==2.11.7 +pydantic_core==2.33.2 +Pygments==2.19.2 +python-dateutil==2.9.0.post0 +pytz==2025.2 +PyYAML==6.0.2 +pyzmq==27.0.0 +ray==2.47.1 +referencing==0.36.2 +requests==2.32.4 +rpds-py==0.25.1 +scipy==1.16.0 +sentry-sdk==2.32.0 +setproctitle==1.3.6 +setuptools==78.1.0 +six==1.17.0 +smmap==5.0.2 +stack-data==0.6.3 +sympy==1.14.0 +tensorboardX==2.6.4 +torch==2.9.0.dev20250628+cpu +torchaudio==2.8.0.dev20250628+cpu +torchvision==0.23.0.dev20250628+cpu +tornado==6.5.1 +tqdm==4.67.1 +traitlets==5.14.3 +typing_extensions==4.14.0 +typing-inspection==0.4.1 +tzdata==2025.2 +urllib3==2.5.0 +wandb==0.20.1 +wcwidth==0.2.13 +autocommand==2.2.2 +backports.tarfile==1.2.0 +importlib_metadata==8.0.0 +inflect==7.3.1 +jaraco.collections==5.1.0 +jaraco.context==5.3.0 +jaraco.functools==4.0.1 +jaraco.text==3.12.1 +more-itertools==10.3.0 +packaging==24.2 +platformdirs==4.2.2 +tomli==2.0.1 +typeguard==4.3.0 +typing_extensions==4.12.2 +wheel==0.45.1 +zipp==3.19.2 diff --git a/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/wandb-metadata.json b/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/wandb-metadata.json new file mode 100644 index 0000000..8bdb7bb --- /dev/null +++ b/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/wandb-metadata.json @@ -0,0 +1,31 @@ +{ + "os": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", + "python": "CPython 3.12.3", + "startedAt": "2025-06-29T05:28:08.882079Z", + "program": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/ml_task_nn.py", + "codePath": "ml_task/ml_task_nn.py", + "git": { + "remote": "git@github.com:IshatV412/FileNest.git", + "commit": "fcebb8e1e8250e16cb6cf1e6b5593c2bc96994ac" + }, + "email": "b24me1034@iitj.ac.in", + "root": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task", + "host": "DESKTOP-7NSUMT9", + "executable": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/mltask/bin/python", + "codePathLocal": "ml_task_nn.py", + "cpu_count": 4, + "cpu_count_logical": 8, + "disk": { + "/": { + "total": "1081101176832", + "used": "6400561152" + } + }, + "memory": { + "total": "3974320128" + }, + "cpu": { + "count": 4, + "countLogical": 8 + } +} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/wandb-summary.json b/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/wandb-summary.json new file mode 100644 index 0000000..4a1afec --- /dev/null +++ b/ml_task/wandb/run-20250629_052807-w4hbtgkl/files/wandb-summary.json @@ -0,0 +1 @@ +{"_wandb":{"runtime":51}} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_052807-w4hbtgkl/run-w4hbtgkl.wandb b/ml_task/wandb/run-20250629_052807-w4hbtgkl/run-w4hbtgkl.wandb new file mode 100644 index 0000000..74a4a25 Binary files /dev/null and b/ml_task/wandb/run-20250629_052807-w4hbtgkl/run-w4hbtgkl.wandb differ diff --git a/ml_task/wandb/run-20250629_053204-mqqqyfii/files/config.yaml b/ml_task/wandb/run-20250629_053204-mqqqyfii/files/config.yaml new file mode 100644 index 0000000..de354ea --- /dev/null +++ b/ml_task/wandb/run-20250629_053204-mqqqyfii/files/config.yaml @@ -0,0 +1,29 @@ +_wandb: + value: + cli_version: 0.20.1 + m: [] + python_version: 3.12.3 + t: + "1": + - 1 + - 30 + - 41 + - 50 + "2": + - 1 + - 30 + - 41 + - 50 + "3": + - 16 + - 55 + "4": 3.12.3 + "5": 0.20.1 + "12": 0.20.1 + "13": linux-x86_64 +batch_size: + value: 64 +epochs: + value: 20 +learning_rate: + value: 0.001 diff --git a/ml_task/wandb/run-20250629_053204-mqqqyfii/files/requirements.txt b/ml_task/wandb/run-20250629_053204-mqqqyfii/files/requirements.txt new file mode 100644 index 0000000..de7bc19 --- /dev/null +++ b/ml_task/wandb/run-20250629_053204-mqqqyfii/files/requirements.txt @@ -0,0 +1,102 @@ +colorama==0.4.6 +psutil==7.0.0 +setproctitle==1.2.2 +annotated-types==0.7.0 +antlr4-python3-runtime==4.9.3 +asttokens==3.0.0 +attrs==25.3.0 +certifi==2025.6.15 +charset-normalizer==3.4.2 +click==8.2.1 +cloudpickle==3.1.1 +comm==0.2.2 +debugpy==1.8.14 +decorator==5.2.1 +executing==2.2.0 +filelock==3.18.0 +fsspec==2025.5.1 +future==1.0.0 +gitdb==4.0.12 +GitPython==3.1.44 +hydra-core==1.3.2 +hyperopt==0.2.7 +idna==3.10 +ipykernel==6.29.5 +ipython==9.3.0 +ipython_pygments_lexers==1.1.1 +jedi==0.19.2 +Jinja2==3.1.6 +jsonschema==4.24.0 +jsonschema-specifications==2025.4.1 +jupyter_client==8.6.3 +jupyter_core==5.8.1 +MarkupSafe==2.1.5 +matplotlib-inline==0.1.7 +mpmath==1.3.0 +msgpack==1.1.1 +nest-asyncio==1.6.0 +networkx==3.5 +numpy==2.3.0 +omegaconf==2.3.0 +packaging==25.0 +pandas==2.3.0 +parso==0.8.4 +pexpect==4.9.0 +pillow==11.2.1 +pip==24.0 +platformdirs==4.3.8 +prompt_toolkit==3.0.51 +protobuf==6.31.1 +psutil==7.0.0 +ptyprocess==0.7.0 +pure_eval==0.2.3 +py4j==0.10.9.9 +pyarrow==20.0.0 +pydantic==2.11.7 +pydantic_core==2.33.2 +Pygments==2.19.2 +python-dateutil==2.9.0.post0 +pytz==2025.2 +PyYAML==6.0.2 +pyzmq==27.0.0 +ray==2.47.1 +referencing==0.36.2 +requests==2.32.4 +rpds-py==0.25.1 +scipy==1.16.0 +sentry-sdk==2.32.0 +setproctitle==1.3.6 +setuptools==78.1.0 +six==1.17.0 +smmap==5.0.2 +stack-data==0.6.3 +sympy==1.14.0 +tensorboardX==2.6.4 +torch==2.9.0.dev20250628+cpu +torchaudio==2.8.0.dev20250628+cpu +torchvision==0.23.0.dev20250628+cpu +tornado==6.5.1 +tqdm==4.67.1 +traitlets==5.14.3 +typing_extensions==4.14.0 +typing-inspection==0.4.1 +tzdata==2025.2 +urllib3==2.5.0 +wandb==0.20.1 +wcwidth==0.2.13 +autocommand==2.2.2 +backports.tarfile==1.2.0 +importlib_metadata==8.0.0 +inflect==7.3.1 +jaraco.collections==5.1.0 +jaraco.context==5.3.0 +jaraco.functools==4.0.1 +jaraco.text==3.12.1 +more-itertools==10.3.0 +packaging==24.2 +platformdirs==4.2.2 +tomli==2.0.1 +typeguard==4.3.0 +typing_extensions==4.12.2 +wheel==0.45.1 +zipp==3.19.2 diff --git a/ml_task/wandb/run-20250629_053204-mqqqyfii/files/wandb-metadata.json b/ml_task/wandb/run-20250629_053204-mqqqyfii/files/wandb-metadata.json new file mode 100644 index 0000000..c43370c --- /dev/null +++ b/ml_task/wandb/run-20250629_053204-mqqqyfii/files/wandb-metadata.json @@ -0,0 +1,31 @@ +{ + "os": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", + "python": "CPython 3.12.3", + "startedAt": "2025-06-29T05:32:05.078184Z", + "program": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/ml_task_nn.py", + "codePath": "ml_task/ml_task_nn.py", + "git": { + "remote": "git@github.com:IshatV412/FileNest.git", + "commit": "fcebb8e1e8250e16cb6cf1e6b5593c2bc96994ac" + }, + "email": "b24me1034@iitj.ac.in", + "root": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task", + "host": "DESKTOP-7NSUMT9", + "executable": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/mltask/bin/python", + "codePathLocal": "ml_task_nn.py", + "cpu_count": 4, + "cpu_count_logical": 8, + "disk": { + "/": { + "total": "1081101176832", + "used": "6400835584" + } + }, + "memory": { + "total": "3974320128" + }, + "cpu": { + "count": 4, + "countLogical": 8 + } +} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_053204-mqqqyfii/files/wandb-summary.json b/ml_task/wandb/run-20250629_053204-mqqqyfii/files/wandb-summary.json new file mode 100644 index 0000000..0fa87bc --- /dev/null +++ b/ml_task/wandb/run-20250629_053204-mqqqyfii/files/wandb-summary.json @@ -0,0 +1 @@ +{"_wandb":{"runtime":47}} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_053204-mqqqyfii/run-mqqqyfii.wandb b/ml_task/wandb/run-20250629_053204-mqqqyfii/run-mqqqyfii.wandb new file mode 100644 index 0000000..55c0664 Binary files /dev/null and b/ml_task/wandb/run-20250629_053204-mqqqyfii/run-mqqqyfii.wandb differ diff --git a/ml_task/wandb/run-20250629_053515-k7srqsrg/files/config.yaml b/ml_task/wandb/run-20250629_053515-k7srqsrg/files/config.yaml new file mode 100644 index 0000000..de354ea --- /dev/null +++ b/ml_task/wandb/run-20250629_053515-k7srqsrg/files/config.yaml @@ -0,0 +1,29 @@ +_wandb: + value: + cli_version: 0.20.1 + m: [] + python_version: 3.12.3 + t: + "1": + - 1 + - 30 + - 41 + - 50 + "2": + - 1 + - 30 + - 41 + - 50 + "3": + - 16 + - 55 + "4": 3.12.3 + "5": 0.20.1 + "12": 0.20.1 + "13": linux-x86_64 +batch_size: + value: 64 +epochs: + value: 20 +learning_rate: + value: 0.001 diff --git a/ml_task/wandb/run-20250629_053515-k7srqsrg/files/requirements.txt b/ml_task/wandb/run-20250629_053515-k7srqsrg/files/requirements.txt new file mode 100644 index 0000000..de7bc19 --- /dev/null +++ b/ml_task/wandb/run-20250629_053515-k7srqsrg/files/requirements.txt @@ -0,0 +1,102 @@ +colorama==0.4.6 +psutil==7.0.0 +setproctitle==1.2.2 +annotated-types==0.7.0 +antlr4-python3-runtime==4.9.3 +asttokens==3.0.0 +attrs==25.3.0 +certifi==2025.6.15 +charset-normalizer==3.4.2 +click==8.2.1 +cloudpickle==3.1.1 +comm==0.2.2 +debugpy==1.8.14 +decorator==5.2.1 +executing==2.2.0 +filelock==3.18.0 +fsspec==2025.5.1 +future==1.0.0 +gitdb==4.0.12 +GitPython==3.1.44 +hydra-core==1.3.2 +hyperopt==0.2.7 +idna==3.10 +ipykernel==6.29.5 +ipython==9.3.0 +ipython_pygments_lexers==1.1.1 +jedi==0.19.2 +Jinja2==3.1.6 +jsonschema==4.24.0 +jsonschema-specifications==2025.4.1 +jupyter_client==8.6.3 +jupyter_core==5.8.1 +MarkupSafe==2.1.5 +matplotlib-inline==0.1.7 +mpmath==1.3.0 +msgpack==1.1.1 +nest-asyncio==1.6.0 +networkx==3.5 +numpy==2.3.0 +omegaconf==2.3.0 +packaging==25.0 +pandas==2.3.0 +parso==0.8.4 +pexpect==4.9.0 +pillow==11.2.1 +pip==24.0 +platformdirs==4.3.8 +prompt_toolkit==3.0.51 +protobuf==6.31.1 +psutil==7.0.0 +ptyprocess==0.7.0 +pure_eval==0.2.3 +py4j==0.10.9.9 +pyarrow==20.0.0 +pydantic==2.11.7 +pydantic_core==2.33.2 +Pygments==2.19.2 +python-dateutil==2.9.0.post0 +pytz==2025.2 +PyYAML==6.0.2 +pyzmq==27.0.0 +ray==2.47.1 +referencing==0.36.2 +requests==2.32.4 +rpds-py==0.25.1 +scipy==1.16.0 +sentry-sdk==2.32.0 +setproctitle==1.3.6 +setuptools==78.1.0 +six==1.17.0 +smmap==5.0.2 +stack-data==0.6.3 +sympy==1.14.0 +tensorboardX==2.6.4 +torch==2.9.0.dev20250628+cpu +torchaudio==2.8.0.dev20250628+cpu +torchvision==0.23.0.dev20250628+cpu +tornado==6.5.1 +tqdm==4.67.1 +traitlets==5.14.3 +typing_extensions==4.14.0 +typing-inspection==0.4.1 +tzdata==2025.2 +urllib3==2.5.0 +wandb==0.20.1 +wcwidth==0.2.13 +autocommand==2.2.2 +backports.tarfile==1.2.0 +importlib_metadata==8.0.0 +inflect==7.3.1 +jaraco.collections==5.1.0 +jaraco.context==5.3.0 +jaraco.functools==4.0.1 +jaraco.text==3.12.1 +more-itertools==10.3.0 +packaging==24.2 +platformdirs==4.2.2 +tomli==2.0.1 +typeguard==4.3.0 +typing_extensions==4.12.2 +wheel==0.45.1 +zipp==3.19.2 diff --git a/ml_task/wandb/run-20250629_053515-k7srqsrg/files/wandb-metadata.json b/ml_task/wandb/run-20250629_053515-k7srqsrg/files/wandb-metadata.json new file mode 100644 index 0000000..897d7b5 --- /dev/null +++ b/ml_task/wandb/run-20250629_053515-k7srqsrg/files/wandb-metadata.json @@ -0,0 +1,31 @@ +{ + "os": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", + "python": "CPython 3.12.3", + "startedAt": "2025-06-29T05:35:16.465207Z", + "program": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/ml_task_nn.py", + "codePath": "ml_task/ml_task_nn.py", + "git": { + "remote": "git@github.com:IshatV412/FileNest.git", + "commit": "fcebb8e1e8250e16cb6cf1e6b5593c2bc96994ac" + }, + "email": "b24me1034@iitj.ac.in", + "root": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task", + "host": "DESKTOP-7NSUMT9", + "executable": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/mltask/bin/python", + "codePathLocal": "ml_task_nn.py", + "cpu_count": 4, + "cpu_count_logical": 8, + "disk": { + "/": { + "total": "1081101176832", + "used": "6401097728" + } + }, + "memory": { + "total": "3974320128" + }, + "cpu": { + "count": 4, + "countLogical": 8 + } +} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_053515-k7srqsrg/files/wandb-summary.json b/ml_task/wandb/run-20250629_053515-k7srqsrg/files/wandb-summary.json new file mode 100644 index 0000000..11e987f --- /dev/null +++ b/ml_task/wandb/run-20250629_053515-k7srqsrg/files/wandb-summary.json @@ -0,0 +1 @@ +{"_wandb":{"runtime":45}} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_053515-k7srqsrg/run-k7srqsrg.wandb b/ml_task/wandb/run-20250629_053515-k7srqsrg/run-k7srqsrg.wandb new file mode 100644 index 0000000..efb61cf Binary files /dev/null and b/ml_task/wandb/run-20250629_053515-k7srqsrg/run-k7srqsrg.wandb differ diff --git a/ml_task/wandb/run-20250629_082305-tmwvkps2/files/config.yaml b/ml_task/wandb/run-20250629_082305-tmwvkps2/files/config.yaml new file mode 100644 index 0000000..16bb7f6 --- /dev/null +++ b/ml_task/wandb/run-20250629_082305-tmwvkps2/files/config.yaml @@ -0,0 +1,25 @@ +_wandb: + value: + cli_version: 0.20.1 + m: [] + python_version: 3.12.3 + t: + "1": + - 1 + - 41 + "2": + - 1 + - 41 + "3": + - 16 + - 55 + "4": 3.12.3 + "5": 0.20.1 + "12": 0.20.1 + "13": linux-x86_64 +batch_size: + value: 64 +learning_rate: + value: 0.001 +num_epochs: + value: 5 diff --git a/ml_task/wandb/run-20250629_082305-tmwvkps2/files/requirements.txt b/ml_task/wandb/run-20250629_082305-tmwvkps2/files/requirements.txt new file mode 100644 index 0000000..f7bcd2f --- /dev/null +++ b/ml_task/wandb/run-20250629_082305-tmwvkps2/files/requirements.txt @@ -0,0 +1,83 @@ +annotated-types==0.7.0 +antlr4-python3-runtime==4.9.3 +asttokens==3.0.0 +attrs==25.3.0 +certifi==2025.6.15 +charset-normalizer==3.4.2 +click==8.2.1 +cloudpickle==3.1.1 +comm==0.2.2 +debugpy==1.8.14 +decorator==5.2.1 +executing==2.2.0 +filelock==3.18.0 +fsspec==2025.5.1 +future==1.0.0 +gitdb==4.0.12 +GitPython==3.1.44 +hydra-core==1.3.2 +hyperopt==0.2.7 +idna==3.10 +ipykernel==6.29.5 +ipython==9.3.0 +ipython_pygments_lexers==1.1.1 +jedi==0.19.2 +Jinja2==3.1.6 +jsonschema==4.24.0 +jsonschema-specifications==2025.4.1 +jupyter_client==8.6.3 +jupyter_core==5.8.1 +MarkupSafe==2.1.5 +matplotlib-inline==0.1.7 +mpmath==1.3.0 +msgpack==1.1.1 +nest-asyncio==1.6.0 +networkx==3.5 +numpy==2.3.0 +omegaconf==2.3.0 +packaging==25.0 +pandas==2.3.0 +parso==0.8.4 +pexpect==4.9.0 +pillow==11.2.1 +pip==24.0 +platformdirs==4.3.8 +prompt_toolkit==3.0.51 +protobuf==6.31.1 +psutil==7.0.0 +ptyprocess==0.7.0 +pure_eval==0.2.3 +py4j==0.10.9.9 +pyarrow==20.0.0 +pydantic==2.11.7 +pydantic_core==2.33.2 +Pygments==2.19.2 +python-dateutil==2.9.0.post0 +pytz==2025.2 +PyYAML==6.0.2 +pyzmq==27.0.0 +ray==2.47.1 +referencing==0.36.2 +requests==2.32.4 +rpds-py==0.25.1 +scipy==1.16.0 +sentry-sdk==2.32.0 +setproctitle==1.3.6 +setuptools==78.1.0 +six==1.17.0 +smmap==5.0.2 +stack-data==0.6.3 +sympy==1.14.0 +tensorboardX==2.6.4 +torch==2.9.0.dev20250628+cpu +torchaudio==2.8.0.dev20250628+cpu +torchvision==0.23.0.dev20250628+cpu +tornado==6.5.1 +tqdm==4.67.1 +traitlets==5.14.3 +typing_extensions==4.14.0 +typing-inspection==0.4.1 +tzdata==2025.2 +urllib3==2.5.0 +wandb==0.20.1 +wcwidth==0.2.13 diff --git a/ml_task/wandb/run-20250629_082305-tmwvkps2/files/wandb-metadata.json b/ml_task/wandb/run-20250629_082305-tmwvkps2/files/wandb-metadata.json new file mode 100644 index 0000000..d34db90 --- /dev/null +++ b/ml_task/wandb/run-20250629_082305-tmwvkps2/files/wandb-metadata.json @@ -0,0 +1,31 @@ +{ + "os": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", + "python": "CPython 3.12.3", + "startedAt": "2025-06-29T08:23:06.442029Z", + "program": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/ml_task_nn.py", + "codePath": "ml_task/ml_task_nn.py", + "git": { + "remote": "git@github.com:IshatV412/FileNest.git", + "commit": "fcebb8e1e8250e16cb6cf1e6b5593c2bc96994ac" + }, + "email": "b24me1034@iitj.ac.in", + "root": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task", + "host": "DESKTOP-7NSUMT9", + "executable": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/mltask/bin/python", + "codePathLocal": "ml_task_nn.py", + "cpu_count": 4, + "cpu_count_logical": 8, + "disk": { + "/": { + "total": "1081101176832", + "used": "6274719744" + } + }, + "memory": { + "total": "3974332416" + }, + "cpu": { + "count": 4, + "countLogical": 8 + } +} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_082305-tmwvkps2/files/wandb-summary.json b/ml_task/wandb/run-20250629_082305-tmwvkps2/files/wandb-summary.json new file mode 100644 index 0000000..6e9ada0 --- /dev/null +++ b/ml_task/wandb/run-20250629_082305-tmwvkps2/files/wandb-summary.json @@ -0,0 +1 @@ +{"epoch":1,"batch_idx":898,"loss":1.6001312732696533,"_timestamp":1.751185530393346e+09,"val_acc":0.3212,"_wandb":{"runtime":144},"_runtime":143.951886312,"_step":1837} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_082305-tmwvkps2/run-tmwvkps2.wandb b/ml_task/wandb/run-20250629_082305-tmwvkps2/run-tmwvkps2.wandb new file mode 100644 index 0000000..d2b38f4 Binary files /dev/null and b/ml_task/wandb/run-20250629_082305-tmwvkps2/run-tmwvkps2.wandb differ diff --git a/ml_task/wandb/run-20250629_082713-l40xw0su/files/config.yaml b/ml_task/wandb/run-20250629_082713-l40xw0su/files/config.yaml new file mode 100644 index 0000000..16bb7f6 --- /dev/null +++ b/ml_task/wandb/run-20250629_082713-l40xw0su/files/config.yaml @@ -0,0 +1,25 @@ +_wandb: + value: + cli_version: 0.20.1 + m: [] + python_version: 3.12.3 + t: + "1": + - 1 + - 41 + "2": + - 1 + - 41 + "3": + - 16 + - 55 + "4": 3.12.3 + "5": 0.20.1 + "12": 0.20.1 + "13": linux-x86_64 +batch_size: + value: 64 +learning_rate: + value: 0.001 +num_epochs: + value: 5 diff --git a/ml_task/wandb/run-20250629_082713-l40xw0su/files/requirements.txt b/ml_task/wandb/run-20250629_082713-l40xw0su/files/requirements.txt new file mode 100644 index 0000000..f7bcd2f --- /dev/null +++ b/ml_task/wandb/run-20250629_082713-l40xw0su/files/requirements.txt @@ -0,0 +1,83 @@ +annotated-types==0.7.0 +antlr4-python3-runtime==4.9.3 +asttokens==3.0.0 +attrs==25.3.0 +certifi==2025.6.15 +charset-normalizer==3.4.2 +click==8.2.1 +cloudpickle==3.1.1 +comm==0.2.2 +debugpy==1.8.14 +decorator==5.2.1 +executing==2.2.0 +filelock==3.18.0 +fsspec==2025.5.1 +future==1.0.0 +gitdb==4.0.12 +GitPython==3.1.44 +hydra-core==1.3.2 +hyperopt==0.2.7 +idna==3.10 +ipykernel==6.29.5 +ipython==9.3.0 +ipython_pygments_lexers==1.1.1 +jedi==0.19.2 +Jinja2==3.1.6 +jsonschema==4.24.0 +jsonschema-specifications==2025.4.1 +jupyter_client==8.6.3 +jupyter_core==5.8.1 +MarkupSafe==2.1.5 +matplotlib-inline==0.1.7 +mpmath==1.3.0 +msgpack==1.1.1 +nest-asyncio==1.6.0 +networkx==3.5 +numpy==2.3.0 +omegaconf==2.3.0 +packaging==25.0 +pandas==2.3.0 +parso==0.8.4 +pexpect==4.9.0 +pillow==11.2.1 +pip==24.0 +platformdirs==4.3.8 +prompt_toolkit==3.0.51 +protobuf==6.31.1 +psutil==7.0.0 +ptyprocess==0.7.0 +pure_eval==0.2.3 +py4j==0.10.9.9 +pyarrow==20.0.0 +pydantic==2.11.7 +pydantic_core==2.33.2 +Pygments==2.19.2 +python-dateutil==2.9.0.post0 +pytz==2025.2 +PyYAML==6.0.2 +pyzmq==27.0.0 +ray==2.47.1 +referencing==0.36.2 +requests==2.32.4 +rpds-py==0.25.1 +scipy==1.16.0 +sentry-sdk==2.32.0 +setproctitle==1.3.6 +setuptools==78.1.0 +six==1.17.0 +smmap==5.0.2 +stack-data==0.6.3 +sympy==1.14.0 +tensorboardX==2.6.4 +torch==2.9.0.dev20250628+cpu +torchaudio==2.8.0.dev20250628+cpu +torchvision==0.23.0.dev20250628+cpu +tornado==6.5.1 +tqdm==4.67.1 +traitlets==5.14.3 +typing_extensions==4.14.0 +typing-inspection==0.4.1 +tzdata==2025.2 +urllib3==2.5.0 +wandb==0.20.1 +wcwidth==0.2.13 diff --git a/ml_task/wandb/run-20250629_082713-l40xw0su/files/wandb-metadata.json b/ml_task/wandb/run-20250629_082713-l40xw0su/files/wandb-metadata.json new file mode 100644 index 0000000..2cb9e77 --- /dev/null +++ b/ml_task/wandb/run-20250629_082713-l40xw0su/files/wandb-metadata.json @@ -0,0 +1,31 @@ +{ + "os": "Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", + "python": "CPython 3.12.3", + "startedAt": "2025-06-29T08:27:14.696512Z", + "program": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/ml_task_nn.py", + "codePath": "ml_task/ml_task_nn.py", + "git": { + "remote": "git@github.com:IshatV412/FileNest.git", + "commit": "fcebb8e1e8250e16cb6cf1e6b5593c2bc96994ac" + }, + "email": "b24me1034@iitj.ac.in", + "root": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task", + "host": "DESKTOP-7NSUMT9", + "executable": "/mnt/c/Users/reete/GoLang/mongoapi/FileNest/ml_task/mltask/bin/python", + "codePathLocal": "ml_task_nn.py", + "cpu_count": 4, + "cpu_count_logical": 8, + "disk": { + "/": { + "total": "1081101176832", + "used": "6274732032" + } + }, + "memory": { + "total": "3974332416" + }, + "cpu": { + "count": 4, + "countLogical": 8 + } +} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_082713-l40xw0su/files/wandb-summary.json b/ml_task/wandb/run-20250629_082713-l40xw0su/files/wandb-summary.json new file mode 100644 index 0000000..2f8b64d --- /dev/null +++ b/ml_task/wandb/run-20250629_082713-l40xw0su/files/wandb-summary.json @@ -0,0 +1 @@ +{"_step":3747,"epoch":3,"val_acc":0.5323,"_wandb":{"runtime":1146},"batch_idx":930,"loss":1.1594164371490479,"_timestamp":1.751186779467483e+09,"_runtime":1144.772036758} \ No newline at end of file diff --git a/ml_task/wandb/run-20250629_082713-l40xw0su/run-l40xw0su.wandb b/ml_task/wandb/run-20250629_082713-l40xw0su/run-l40xw0su.wandb new file mode 100644 index 0000000..63c4e5f Binary files /dev/null and b/ml_task/wandb/run-20250629_082713-l40xw0su/run-l40xw0su.wandb differ